[fpc-devel] assign constant text to widestring

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Oct 23 12:37:15 CEST 2008


On 23 Oct 2008, at 12:20, Michael Schnell wrote:

>> 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.

As has been said before: the compiler itself simply does not support  
UCS-2. Regardless of any BOM, compiler setting or Lazarus setting, it  
will not understand it.


Jonas



More information about the fpc-devel mailing list