[fpc-pascal] Delphi / FPC and UTF8 BOM

Zaher Dirkey parmaja at gmail.com
Tue Oct 21 18:20:57 CEST 2008


>> 2- If i put {$codepage utf-8} in my unit and i have string A variable,
>> that variable will be widestring and any ansistring assigned to it
>> will converted to it?
>
> No, A will be a shortstring (in {$h-} mode) or ansistring (in {$h+} mode).
> Only *constant* strings containing non-ASCII characters will be converted
> into a widestring at compile time if a codepage is set, so they can be
> converted to the current code page at run time (since ansi/shortstrings are
> always supposed to be encoded using the current code page, and this code
> page can vary from execution to execution).
>
You fixed my mistakes :)

Is that mean when i want to compile my project to UTF-8 (or Unicode),
that mean must change my variables to widestring, A:string to
A:widestring (i remember old discuss somewhere about this), is there a
string type switched between two types when i choose the unicode in
compile, or make "string" type be a widestring (that my mistake in
fact)?



More information about the fpc-pascal mailing list