From: Sean Russell Date: 2001-11-12T02:51:53+09:00 Subject: [ruby-talk:24884] Re: XML libraries (Re: Re: ruby and webservices) Bob Hutchison wrote: > 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. Then we have a problem. Until Ruby regular expressions (and Ruby Strings in general) support UTF-16, supporting UTF-16 is going to be problematic in any Ruby application. I see two solutions: 1) implement a byte-wise implementation of an XML parser in Ruby, and support UTF-16 explicitly, and 2) use a native XML parser, like XMLParser does, and support UTF-16 on the Ruby side explicitly. (1) would be very slow. REXML is as fast as it is because it uses the native Ruby REGEX code to do most of the grunt-work of the parsing. Both would be troublesome for users. The best solution, of course, is for UTF-16 support natively in Ruby. Then all of the Ruby XML parsers would automatically become UTF-16 compliant -- or, at least, with minimal code tweaking. --- SER -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==-----