[Lazarus] UTF8 RTL for Windows

Hans-Peter Diettrich DrDiettrich1 at aol.com
Tue Nov 25 11:53:00 CET 2014


Mattias Gaertner schrieb:
> On Mon, 24 Nov 2014 22:53:44 +0100
> Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
> 
>> Graeme Geldenhuys schrieb:
>>
>>> How is ThousandSeparator and DecimalSeparator supposed to work it
>>> TFormatSettings? If you switched the RTL to UTF-8 or UTF-16 a Russian
>>> thousand separator (4-byte non-breaking white space character) for
>>> example will not fit into a Char type.
>> The Char type is quite useless with Unicode,
> 
> Correction: *This* Char type needs to be extended.

Please specify.

> "Char" in general is very useful.
> 
>> at least if it has less 
>> than 3 bytes (4 for UTF-8). There exist many more flaws in the RTL/LCL, 
>> assuming that a character always fits into a Char (like the Pos 
>> overload...).
> 
> There is a Pos overload for strings. Where is the flaw in Pos?

The flaw is the added overload with a Char parameter.
Furthermore the Pos arguments should never be subject to automatic 
conversion, otherwise the returned index will be useless.


>> In the best case Char could be retyped into an string (substring),
> 
> That would be wrong in 99.9% of the cases.

Please give at least one example.

DoDi





More information about the Lazarus mailing list