From: martin@... (Martin v. Loewis) Date: 2001-11-14T09:32:16+09:00 Subject: [ruby-talk:25121] Re: XML libraries (Re: Re: ruby and webservices) Sean Russell writes: > > 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. > > By byte strings, do you mean ASCII strings? No. Converting between ASCII (American Standard Code for Information Interchange, consisting of 128 characters) and Unicode is trivial. The real-world problem is that you are given a sequence of objects with 256 possible values each. Let's call those objects bytes (not characters), and the sequence of them byte strings (not ASCII strings). ASCII strings are a specific case of byte strings: all bytes have values below 128, and the application assumes that 32 indicates SPACE (and not, say PADDING CHARACTER, as it would in EBCDIC). I believe what Ruby calls a "string" really is a "byte string" for most purposes (perhaps except for parsing scripts, where it matters what encoding you have to properly recognize identifiers, keywords, numbers and so on). Regards, Martin