[fpc-pascal] LowerCase vs. UnicodeLowerCase

LacaK lacak at zoznam.sk
Wed Oct 5 09:11:51 CEST 2016


Hi,

I have this simple program (on Windows):

uses
   Classes, SysUtils;

var
   US: UnicodeString;

begin
   US := 'ÁÉÍ';
   writeln(LowerCase(US)); // prints ÁÉÍ
   writeln(UnicodeLowerCase(US)); // prints áéí
end;

Why first LowerCase() does nothing while second wroks as expected?

Looking at sources there is UnicodeString version of LowerCase() and in 
both cases is called widestringmanager.LowerUnicodeStringProc ...

Aha ... (I got it while writing this email)
There is Lowercase(Const S : UnicodeString) : UnicodeString; also in 
System and also in SysUtils !
And LowerCase in SysUtils works only for A-Z while in System works with 
widestringmanager

So
   writeln(System.LowerCase(US)); // prints áéí

Now I understand what happens, but isn't it bit confusing ?
(as lot of programs has SysUtils in uses clause, so SysUtils version 
overrides System version ?)

-Laco.




More information about the fpc-pascal mailing list