From: martin@... (Martin v. Loewis) Date: 2001-11-12T16:38:34+09:00 Subject: [ruby-talk:24908] Re: XML libraries (Re: Re: ruby and webservices) Bob Hutchison writes: > > So, if the parser support only one encoding, it should be UTF-8, > > and documents in other encoding should be converted to UTF-8. > > > > Is it good solution? > > No I don't think so. How you represent the character stream internally is > entirely up to you (immediate *internal* conversion to UTF-8 by your parser > is OK). Restricting input to UTF-8 will place an impossible to live with > constraint on the use of your parser. Presumably having an XML parser is to > allow ruby programs to participate in a larger context -- and this larger > context isn't going to provide encoding conversions. It seems that Ruby needs a conversion library, then. Convert every input in a different encoding to UTF-8 first, and assume that all further processing is done in UTF-8. In fact, this is what Expat does already. It isn't the "context" that needs to perform the conversion; the parser could do this as well. Regards, Martin