1.8's currently used on Debian and Ubuntu.  I recall seeing user problems with US-ASCII data getting stored from LDAP(?), so this is definitely welcome.

I think a conditional's the best way of doing it, e.g.

<pre>
if attrs[v].respond_to? :force_encoding
  # existing code
else
  attrs[v] = Iconv.new('UTF-8//IGNORE', 'UTF-8').iconv(attrs[v]) rescue attrs[v]
end
</pre>

That's roughly equivalent to the force_encoding bit I think, skipping the actual character encoding change you're doing after (useful, but that's a nice to have for 1.8 at this stage I'd say, unless you want to check how to do it with iconv).