[fpc-devel] Unicode support - for the 20th time... ;-)
vsnijders at vodafonevast.nl
Thu Nov 20 13:58:52 CET 2008
Graeme Geldenhuys schreef:
> Hello again,
> We are seeing more and more "hacks" being applied to projects trying
> to scramble around the missing FPC feature - no built-in Unicode
> A simple example in Lazarus.... Loading a UTF-8 encoded file into a TMemo.
> Normally you would write code as follows (for ANSI text):
> Unfortunately that doesn't work if the file contains unicode content,
> so the following "hack" is required which is quite nasty:
> ls := TStringList.Create;
> for i := 0 to ls.Count-1 do
> ls[i] := UTF8Encode(ls[i]);
To make matters worse, things don't get clear, if mistakes like above
For Lazarus it works if the file is UTF8 encoded and doesn't work if it
has the system encoding<>UTF8.
If the file is UTF8 encoded,
works, currently, in Lazarus.
If the file is not UTF8 encoded - which implies, that it is not ASCII
either - then you need to convert it to UTF8 before assigning it to the
I hope, I didn't make a mistake myself here.
More information about the fpc-devel