From: martin@... (Martin v. Loewis) Date: 2001-11-12T16:38:34+09:00 Subject: [ruby-talk:24909] Re: XML libraries (Re: Re: ruby and webservices) Sean Russell writes: > How can you possibly read UTF-16 and not be able to write it back out. Why is it a problem? Nobody uses XML documents in UTF-16. So *if* you come across a document in UTF-16, the spec mandates that you should be able to process it. There is nothing wrong with writing it back out as UTF-8. > Further, you have to be able to give it to the User in some useable format. > Not all UTF-16 maps to UTF-8 ??? It certainly does. It used to be the other way 'round: Not all UTF-8 maps to UTF-16, but today, UTF-8 and UTF-16 encode the exact same characters. > Yeah, I agree. If Java got one thing right, it was detaching > characters from bytes, and supporting UTF out of the box. That is also the approach Python took; you also need a powerful encoding library to go with the character string type, to convert between byte strings and character strings. Regards, Martin