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.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to