From: James Edward Gray II Date: 2010-11-25T01:07:09+09:00 Subject: Re: Ruby 1.8 vs 1.9 On Nov 24, 2010, at 9:47 AM, Phillip Gawlowski wrote: > On Wed, Nov 24, 2010 at 4:15 PM, Brian Candler wrote: > >> For example, say I have s1 tagged UTF-8 and s2 tagged ISO-8859-1. If >> "s1+s2" always raised an exception, it would be easy to find, and easy >> to fix. >> >> However the 'compatibility' rules mean that this is data-sensitive. In >> many cases s1+s2 will work, if either s1 contains non-ASCII characters >> but s2 doesn't, or vice-versa. It's really hard to get test coverage of >> all the possible cases - rcov won't help you - or you just cross your >> fingers and hope. > > Convert your strings to UTF-8 at all times, and you are done. You have > to check for data integrity anyway, so you can do that in one go. Thank you for being the voice of reason. I've fought against Brian enough in the past over this issue, that I try to stay out of it these days. However, his arguments always strike me as wanting to unlearn what we have learned about encodings. We can't go back. Different encodings exist. At least Ruby 1.9 allows us to work with them. James Edward Gray II