[fpc-pascal] LowerCase vs. UnicodeLowerCase

Virgo Pärna virgo.parna at mail.ee
Sat Oct 8 08:04:39 CEST 2016


On Wed, 5 Oct 2016 09:11:51 +0200, LacaK <lacak at zoznam.sk> wrote:
>    writeln(LowerCase(US)); // prints ÁÉÍ
>    writeln(UnicodeLowerCase(US)); // prints áéí
>
> Why first LowerCase() does nothing while second wroks as expected?
>

	SysUtils.LowerCase is only supposed to work on ascii characters. 
>From manual:
-----------------------------------------------------------------------
LowerCase returns the lowercase equivalent of S. Ansi characters are not
taken into account, only ASCII codes below 127 are converted. It is
completely equivalent to the lowercase function of the system unit, and
is provided for compatibility only. 
-----------------------------------------------------------------------
	But that last sentence suggests that System.LowerCase should work same
way. But it's manual entry says:
-----------------------------------------------------------------------
Lowercase returns the lowercase version of its argument C. If its
argument is a string, then the complete string is converted to
lowercase. The type of the returned value is the same as the type of the
argument. 
-----------------------------------------------------------------------
	So, which version is correct one? Delphi LowerCase also only
works on ascii characters.

-- 
Virgo Pärna 
virgo.parna at mail.ee




More information about the fpc-pascal mailing list