[fpc-devel] Unicode resource strings
alexione at gmail.com
Tue Aug 21 12:02:13 CEST 2012
On Tue, Aug 21, 2012 at 11:41 AM, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:
> Theoretically you could rewrite the FCL to support UTF8String,
> UnicodeString and AnsiString. But not at the same time. In an
> application there is always be only one of them. So you have to ship for
> each flavor a whole FCL plus all packages that depends on it.
> I guess the FPC team wants to support at most one legacy and one
> Unicode version. And eventually only the Unicode version.
Another idea is to use String all over the place as a generic string
which can hold string in any encoding (probably another modeswitch for
this?). So, (in theory) TStrings could store both UTF8 and UTF16
strings at the same time, and compiler magic would do necessary
conversions when needed. Now, since I don't really know much about
compiler internals, I'll try to give it some time and see if above
idea is applicable at all.
>> In my experience, only about 1% of applications requires handling of
>> individual Unicode characters (input, rendering, GUI text editing).
>> Other parts of application can happily without that knowledge :-)
> But that 1% may be scattered around the whole application and there
> are no compiler warnings, so it is hard to find all places.
Yes, they will most probably be scattered all around, but then - it's
developer-related organizational challenge, not compiler one.
More information about the fpc-devel