From: Robert Klemme Date: 2003-06-02T17:23:50+09:00 Subject: Re: ruby unicode./encoding support "Carlos" schrieb im Newsbeitrag news:20030528161716.GA4410@quovadis.com.ar... > > Use the 'jcode' library, and set the encoding to unicode with the -K > > option (or by setting the KCODE variable). jcode overrides most of the > > methods in class String so that they support the encoding you set with > > the -K option. The exception is the length and size methods: it leaves > > these untouched and instead gives you two new methods, jlength and jsize: It seems that one has has to set the encoding on a per process basis. Is this so? I find it a bit strange. IMHO the downside is, that you either can't read from different sources with different encodings in one application *or* you very carefully have to ensure that no other thread is reading / writing while the encoding is temporarily changed. Personally I think Java has one of the best approaches taken here: all strings consist of unicode characters and streams have an encoding attached that is applied during reading and writing. Maybe this is not the ideal solution for ruby. Maybe one should add a class UnicodeString that supports encodings and conversions. What do others think? Cheers robert