[fpc-pascal] Unicode chars losing information

Michael Van Canneyt michael at freepascal.org
Tue Mar 9 08:12:11 CET 2021



On Tue, 9 Mar 2021, Graeme Geldenhuys via fpc-pascal wrote:

>
> On 08/03/2021 2:49 pm, Michael Van Canneyt via fpc-pascal wrote:
>> In that sense, unicode conversion support is something optional and so we 
>> require you to enable it explicitly, since enabling it has some drawbacks:
>
> Surely if you explicitly use the UnicodeString type, the compiler should
> know you are using UTF-16 (the default encoding of said type), so why not
> include the required units implicitly. It doesn't make sense otherwise.

The system unit is full of unicodestring typed routines, same for sysutils.
Mostly they are overloads of single-byte versions of the same call.

Being on Linux, I use only the UTF8 single-byte version of these calls.

So no, I don't need UTF16 despite that these calls are present in units that I am
using. So I know this, but the compiler does not.

Maybe with WPO the compiler would be able to deduce it, but even then I am
not sure it can establish this with 100% certainty.

Michael.


More information about the fpc-pascal mailing list