[fpc-pascal] Unicode characters in source code
XHajT03 at hajny.biz
Wed Apr 21 12:30:09 CEST 2010
On Wed, April 21, 2010 12:03, Graeme Geldenhuys wrote:
> Tomas Hajny het geskryf:
>> What do you mean by "messing with the -Fcutf8 parameter"? If you include
>> some character constants outside the us-ascii set, you should always
>> the compiler how to evaluate them, because the evaluation depends on the
> fpGUI uses UTF-8 internally on all platforms. Specifying some Unicode
> characters as a sequence of bytes stored inside an TfpgString type (alias
> for AnsiString) causes no problems with FPC. To the compiler it's simply a
> sequence of bytes. fpGUI has it's one UTF-8 file and string manipulation
This is the important part which was missing in your original message -
you don't use Unicode specific types (UnicodeChar, UnicodeString,
UTF8String, etc.). As mentioned in my e-mail, my comment was primarily
related to using these types. Obviously, if you use a type which is
"transparent" from this point of view, everything is up to you.
> The usage of #xxxx format also overcomes some problems with editors not
> fully supporting Unicode or when you use a non-Unicode font in your
> For example, I use a non-Unicode font (Raize) under Linux with Lazarus
> If I try and insert true Unicode characters inside the editor, things
> screw-up and text is garbled.
Yes, the alternative notation solves that problem indeed.
More information about the fpc-pascal