On 23-Apr-07, at 8:40 AM, Arnaud Nicolet wrote:

> Le 23 avr. 07 à 16:35 Soir, [EMAIL PROTECTED] a écrit:
>
>> Note that if this binary data is actually text, it's up to you to
>> keep track of what encoding it is.
>
> Can you tell me again how we can figure out the encoding of a text
> for which we don't know the origin? I think you already explained,
> but I'm not sure (I'm not even sure it's possible in RB).

This is a good question since if you read a file you may or may not  
be able to guess the encoding using some means (BOM, etc)
There is a GuessJapaneseEncoding which will only guess what Japanese  
encoding encoding text may be.

If you do something like

   Dim f As FolderItem
   Dim t As TextInputStream
   f= GetOpenFolderItem("text") //file type defined in File Type Sets  
Editor
   If f <> Nil then
     t=f.OpenAsTextFile

Now how can you GUESS what encoding an arbitrary text file is so you  
can read it properly ?
If you do nothing RB assigns an "encoding" which may be entirely wrong.
And if you do not assign one then other operations may not work  
correctly (display, etc)

Ideas ?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to