[fpc-pascal] Unicode chars losing information

Tomas Hajny XHajT03 at hajny.biz
Mon Mar 8 16:11:14 CET 2021


On 2021-03-08 15:49, Michael Van Canneyt via fpc-pascal wrote:
> On Mon, 8 Mar 2021, Adriaan van Os via fpc-pascal wrote:
>> Michael Van Canneyt via fpc-pascal wrote:
>> 
>>> You didn't configure your environment to deal correctly with Unicode.
>> 
>> Wow ! what a sentence !
>> 
>> That sounds like "you didn't configure your car correctly to also take 
>> corners to the right."
> 
> A car that does not turn is unusable.
> 
> Programs that don't need unicode conversions exist and are perfectly 
> usable.
> 
> In that sense, unicode conversion support is something optional and so
> we require you to enable it explicitly, since enabling it has some
> drawbacks:
> - Links to C libs if you use cwstring
> - Increases your binary substantually if you use fpwidestring and
> include all needed characters.

The trouble is - when exactly should the supposed warning be issued? At 
compile time if there are Unicodestring variables and/or constants 
involved, but the Widestring manager is not included in the final binary 
(even though those Unicodestrings might never contain a single character 
outside of US ASCII, because those UnicodeStrings were simply used 
within one of the used units)? That would be all demo programs including 
the Eratosthenes demo due to use of Unicodestring within the RTL. At 
runtime by checking every single character if it falls outside of the 
supported range (with probably considerable performance impacts)? Note 
that this wouldn't guarantee proper displaying of the particular 
character either (e.g. due to the particular font not containing the 
needed glyph, etc.). Or?

Tomas


More information about the fpc-pascal mailing list