[fpc-devel] assign constant text to widestring

Michael Schnell mschnell at lumino.de
Thu Oct 23 12:20:10 CEST 2008


>
> No no, a string with unicode characters is interpreted by the compiler 
> as widestring constant, never as UTF-8 ansistring constant. If it does 
> otherwise, the compiler probably does not interpret your source code 
> as Unicode.
> The issue might be the UCS-2 encoding of your source, perhaps try to 
> feed the compiler UTF-8, I didn't even know the compiler accepts 
> UCS-2, it may not work correctly.
Maybe you pinpointed the cause of the constant assigning issue I see 
here. There is no selectable option in Lazarus to use UCS-2 coded source 
files, it seems to be set to utf-8 on default and I never changed it. 
Nonetheless my source file is stored as clean UTF-2 including correct 
BOM. So maybe the compiler is fooled by Lazarus in some way.

But even if this in fact is a Lazarus- and not an  FPC- problem, not 
decently converting UTF8String <-> WideString seems an essential issue, 
nonetheless, even if this problem in many cases is triggered by the LCL 
using UTF-8 for everything.

-Michael



More information about the fpc-devel mailing list