James Gray wrote:
> Certain encoding options have default settings relating to the
> environment they run in, but none of that matters if specify the
> desired encodings for your source and/or IO objects.

Put another way: write extra code to defend against environment 
pollution, and hope that you haven't forgotten any places where it is 
required.

>> It is quite difficult to get it behave sanely, and is such a mess  
>> that I stick with ruby 1.8.
> 
> Ruby 1.8 had a single global variable that, when set, changed the
> behavior of all code in the interpreter, including the stuff I didn't
> write.  I hope that isn't your idea of a "sane" system.

Ruby 1.8 treated strings as sequences of 8-bit bytes unless explicitly 
told otherwise. That is sane.

Here is an example of the sort of problems still being caused by String 
in 1.9:
http://groups.google.com/group/rack-devel/browse_thread/thread/99628ed37ac5f5b

> Ruby 1.9 probably does require us to learn the bare minimum about how
> character encodings are handled.

Which is rather difficult if it's not documented. Yes I know there have 
been some third-party efforts, including your own, but I have yet to see 
anything which is anywhere near complete.

> It's about time.  How many years
> have we tried to get by with crossed fingers and a prayer that it
> would just work out?  Character encodings should have been required
> reading long before now.

Sure, people who process text need to understand character encodings. 
But text is a small subset of data. When you're processing JPEGs or PDFs 
or ASN1 certificates or HTTP POSTs, you just want something that's 8-bit 
clean.

> For years the Ruby community has begged for more speed and robust
> character encoding support.  The core team delivered that and much
> more this January with a production release that's substantially
> faster and has a very powerful new encoding engine.

Nobody's complaining about improved performance. I'm saying there is 
still much pain to be had by using 1.9, and advising that people may 
wish to avoid the pain until (hopefully) most of it has gone away. 
Anyone who has had no pain with 1.9 or libraries which don't work under 
1.9 is free to speak up.

> To repay their
> monumental efforts, we complain and urge people to stick with Ruby
> 1.8.  We must truly be the most ungrateful lot of bums ever.

Who's "we"? Speakly only for myself, I didn't ask for String to be 
changed in this way. And does the amount of effort which went in mean 
that I am forbidden from saying that I don't like the result?

Regards,

Brian.
-- 
Posted via http://www.ruby-forum.com/.