On Apr 23, 2007, at 19:15 UTC, Arnaud Nicolet wrote: > > Of course, since we live in an ASCII/Unicode world, you'd have to > > make ASCII/Unicode to Arnaud and Arnaud to ASCII/Unicode conversion > > routines. > > So, in RB, we have to compute every byte read. > There is no way of having the encoding predefined?
This has nothing to do with RB. This has purely to do with information. If I give you the bytes 3D FA C4 B6, along with (to make it even easier!) the clue that each byte corresponds to one character, can you tell me what the text is with absolute certainty? No, you cannot. It's not enough information. In addition to the bytes, you also need to know the mapping from bytes to characters. We call that mapping a "text encoding" and it's the additional information that any system needs (implicitly or explicitly) to interpret bytes as text. > Like when we say: > ConvertEncoding(MyText,Encodings.UTF8), RB knows UTF8 and does not > compute the bytes itself (there is something that I don't know > which handles automatically UTF8). Yes, and RB "automatically" handles many dozens of other encodings too -- virtually every text encoding that's still in common use today. You don't have to know the gory details of HOW bytes are mapped to text and vice versa, but you do have to tell RB which mapping to use. That's the part that isn't automatic, and can't be (not with 100% certainty at least), in cases where all you have to go on is the bytes. Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
