From: Bob Hutchison Date: 2001-11-12T21:32:48+09:00 Subject: [ruby-talk:24923] Re: XML libraries (Re: Re: ruby and webservices) On 01/11/11 8:52 PM, "Sean Russell" wrote: > Bob Hutchison wrote: > >> Yes, but not quite as bad as it seems at first. All you have to do is >> *read* UTF-8 and UTF-16, you do not have to use either character encoding >> internally and you can output any encoding you like (though to be safe you > > How can you possibly read UTF-16 and not be able to write it back out. By converting UTF-16 to some other encoding immediately. UTF-16 does not need to be the internal encoding -- your programming environment doesn't have to work with everything just one encoding (and the point is that whatever that might be it should cover the basics; 7 or 8 bit ASCII does not). If it isn't the internal encoding, then you have to convert from the internal to UTF-16 on output. If you didn't provide that conversion capability then... Now *why* wouldn't you is a completely different question and I can't think of a good reason other than timing (other things might take priority but sooner or later a conversion will be possible; someone with get fed up and just do it). > Further, you have to be able to give it to the User in some useable format. Do you mean the Ruby program? I'm not sure who/what you mean here. > Not all UTF-16 maps to UTF-8, so I don't see a read-only implementation as > a solution. For me, the XML read-write operations must be XML reflexive. Are you sure about that first part? All XML implementations are supposed to read UTF-8 and UTF-16, so writing UTF-8 only, for example, allows your output to communicate with any XML implementation. If what you mean by reflexive is for a ruby program to participate in a stream or succession of different XML processors then this is all that is needed. Bob