[fpc-devel] Unicode support (again)
jonas.maebe at elis.ugent.be
Tue Nov 11 10:57:17 CET 2008
On 11 Nov 2008, at 09:30, Michael Schnell wrote:
>> Edit1.Caption := UTF8Encode('hallo äöü');
> Grrrrrrr, how ugly !
> No "old school" Delphi user will understand/accept that you can't
> just do "Edit1.Caption := 'hallo äöü';"
You are mixing two things here:
a) you said that
> "Seemingly if [FPC] detects it to be UTF8 coded and a certain
> (otherwise correct) option is set, even "s := 'hallo äöü'; " does
> not work correctly as expected if s is a WideString"
That is apparently plain wrong and that is what I reacted to.
b) Vincent showed how in Lazarus, which is now fully based on UTF-8,
you can work around the lack of built-in UTF-8 support in FPC, and I
replied with a safer way (which moreover introduces less overhead --
although it is unproductive to complain about the fact that the
function you have to call for this is slow, because if the compiler
does this automatically it can easily get even slower without you
noticing because all conversions are hidden).
You don't have to convince anyone of the fact that these manual
conversions are not an optimal situation, but please keep "existing
functionality does not work correctly" (e.g., assigning constant
strings to widestrings, which does work correctly under all
circumstances) and "feature x is not implemented" (e.g., automatic
support for UTF-8 strings at run time) clearly separated.
More information about the fpc-devel