[fpc-pascal] Delphi / FPC and UTF8 BOM

Martin Schreiber fpmse at bluewin.ch
Wed Oct 22 13:33:08 CEST 2008


On Wednesday 22 October 2008 12.33:59 Marco van de Voort wrote:

>
> The solution of Tiburon is the same as Florian's original solution for the
> multi unicode string type TUnicodeString (that now is still UTF16 only):
> add an encoding field to ansistring, and alter ansistring declaration with
> an encoding type:
>
> Type
>  TUtf8String = ansistring (cp_UTF8);
>
> This way you can explicitely flag anything internal as UTF-8, and
> communicate with the outside 1-byte world using the native codepage (which
> might be UTF-8 too, if desired)
>
> The solution has Windows written all over it (including viewer UTF-8 as a
> codepage), but it has merits IMHO.

Are you sure about the encoding field for every string instance? It could be 
done by compiler magic and an encoding field in the typeinfo too?

Martin



More information about the fpc-pascal mailing list