Jonas Maebe schreef:

On 11 Nov 2008, at 15:26, Vincent Snijders wrote:

Jonas Maebe schreef:
It seems much more advisable to me to save the file with an UTF-8 BOM, or even better to add {$encoding utf-8} (and/or to pass -Fcutf-8 to the compiler) and then just use
Edit1.Caption := UTF8Encode('hallo äöü');

As an extra bonus of not adding the UTF-8 BOM, you don't have to use conversions to assign the UTF8 string in the source, translated by the compiler to a UTF16 string, to an UTF8 encoded ansistring. It saves a conversion at compile time and a conversion at run time.

And breaks all widestring usage.


Breaking *all* widestring usage is maybe a little exagerated, but it gets more complicated, certainly. All widestring usages have to use UTF8Decode. Fortunately, in Lazarus code widestrings are not used that often, I think. At least less often than UTF-8 encoded strings in ansistrings.

Vincent
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to