You can't get this to work to 100%, but one steep on the way is
If you write a "Text File Reading" app then..
1 - Always check for
1.a xml encoding
1.b html encoding
1.c UTF BOOM
Then also add a menu: Reopen with Encoding
Just a note on the way..
On 2007-04-23, at 19:55, Norman Palardy wrote:
>> 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")
> 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 ?
>
>
Sven E
-----------------------
REALbasic 2007R1 OS X 10.4.8 Intel and 10.4.6 PPC
SEEdit Maxi THE XHTML EDITOR FOR MACINTOSH
http://www.seedit.info
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>