From: Eric Hodel Date: 2011-10-26T06:53:51+09:00 Subject: [ruby-core:40379] Re: Counseling On Oct 23, 2011, at 4:05 PM, Perry Smith wrote: > On Oct 23, 2011, at 12:56 PM, Steve Klabnik wrote: >> Also, I don't know the specifics of 8859-1, but there are some >> encodings that are just simply not compatible with each other. Try >> adding a UTF-8 string to an ASCII string, for example... > > I believe your example is not right but the general case is true. If string A is > encoded in EnA and string B is encoded in EnB, then it can happen that > A can not be re-encoded in EnB nor B re-encoded in EnA. > > But as far as I know, Unicode claims to be able to encode everything and > UTF-8 is just a more compact version of Unicode. I believe (perhaps mistakenly) > that everything can be re-encoded to Unicode (and thus encoded to UTF-8). Coding > everything in Unicode is how a lot of other languages deal with this problem. This is the issue. For certain encodings you can't round-trip through Unicode and get back your input document, so ruby does not automatically perform such conversions on your behalf. You can look back through the archives to find threads on the specifics.