On May 02, 2006, at 11:41 UTC, Arnaud Nicolet wrote:

> t.Write EFMyText.Text
> 
> The text is supposed to have high-ascii characters because of my  
> current language.

You mean "non-ASCII characters," but otherwise, yes.

> Then, I open the file using TextEdit. The file does not have the  
> correct encoding (well, it can be expected).

You could just as well expect TextEdit to get it right.  But apparently it did 
not in this case.  It has to guess what encoding the file is; there are some 
hints you can provide (like writing out a BOM sequence at the start of the 
file), but sometimes you have to just tell it (using the Encoding pop-up that 
appears in TextEdit's Open dialog).

> So I change
> t.write EFMyText.Text
> to
> t.Write ConvertEncoding(EFMyText.Text,Encodings.UTF8)
> (the magically used UTF8)
> 
> but the problem remains.

As it should; the above code does nothing, because EFMyText.Text is already 
UTF-8.

> Is it possible to write to a text file (no rtf data) so that it  
> "knows" the wanted encoding?

Nope.

> (I guess it should, otherwise, what a problem around the world!)

Indeed!

> I guess I can tell TextEdit to use a specific encoding when I open  
> the file, but I doubt it's the correct way (I would prefer to have  
> saved the file correctly rather than repairing when the file is open  
> later, with any application).

You saved it correctly; telling TextEdit what the encoding is is not 
"repairing" the file but just a fact of life in a multi-encoding world.  
Someday, nearly everybody will be using UTF-8, and then apps like TextEdit will 
default to that as their first guess, and this will be less of a problem.

Best,
- Joe

--
Joe Strout -- [EMAIL PROTECTED]
Available for custom REALbasic programming or instruction.

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to