mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 15:40:23 +02:00
Expands lowercase and disables the tables
git-svn-id: trunk@32740 -
This commit is contained in:
parent
9c098f91e3
commit
1d224762e2
@ -61,7 +61,7 @@ function UTF8Copy(const s: string; StartCharIndex, CharCount: PtrInt): string;
|
|||||||
procedure UTF8Delete(var s: String; StartCharIndex, CharCount: PtrInt);
|
procedure UTF8Delete(var s: String; StartCharIndex, CharCount: PtrInt);
|
||||||
procedure UTF8Insert(const source: String; var s: string; StartCharIndex: PtrInt);}
|
procedure UTF8Insert(const source: String; var s: string; StartCharIndex: PtrInt);}
|
||||||
|
|
||||||
function UnicodeLowercase(u: cardinal): cardinal;
|
//function UnicodeLowercase(u: cardinal): cardinal;
|
||||||
function UTF8LowerCase(const AInStr: utf8string): utf8string;
|
function UTF8LowerCase(const AInStr: utf8string): utf8string;
|
||||||
function UTF8LowerCase(const AInStr, ALocale: utf8string): utf8string;
|
function UTF8LowerCase(const AInStr, ALocale: utf8string): utf8string;
|
||||||
function UTF8UpperCase(const AInStr: utf8string): utf8string;
|
function UTF8UpperCase(const AInStr: utf8string): utf8string;
|
||||||
@ -92,7 +92,7 @@ var
|
|||||||
FNeedRTLAnsi: boolean = false;
|
FNeedRTLAnsi: boolean = false;
|
||||||
FNeedRTLAnsiValid: boolean = false;
|
FNeedRTLAnsiValid: boolean = false;
|
||||||
|
|
||||||
var
|
{var
|
||||||
UnicodeLower00C0_00DE: array[$00C0..$00DE] of word;
|
UnicodeLower00C0_00DE: array[$00C0..$00DE] of word;
|
||||||
UnicodeLower0100_024E: array[$0100..$024E] of word;
|
UnicodeLower0100_024E: array[$0100..$024E] of word;
|
||||||
UnicodeLower0386_03AB: array[$0386..$03AB] of word;
|
UnicodeLower0386_03AB: array[$0386..$03AB] of word;
|
||||||
@ -781,7 +781,7 @@ begin
|
|||||||
UnicodeLower2C60_2CE2[$2CDE]:=$2CDF;
|
UnicodeLower2C60_2CE2[$2CDE]:=$2CDF;
|
||||||
UnicodeLower2C60_2CE2[$2CE0]:=$2CE1;
|
UnicodeLower2C60_2CE2[$2CE0]:=$2CE1;
|
||||||
UnicodeLower2C60_2CE2[$2CE2]:=$2CE3;
|
UnicodeLower2C60_2CE2[$2CE2]:=$2CE3;
|
||||||
end;
|
end; }
|
||||||
|
|
||||||
function NeedRTLAnsi: boolean;
|
function NeedRTLAnsi: boolean;
|
||||||
{$IFDEF WinCE}
|
{$IFDEF WinCE}
|
||||||
@ -1012,7 +1012,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function UnicodeLowercase(u: cardinal): cardinal;
|
{function UnicodeLowercase(u: cardinal): cardinal;
|
||||||
begin
|
begin
|
||||||
if u<$00C0 then begin
|
if u<$00C0 then begin
|
||||||
// most common
|
// most common
|
||||||
@ -1037,7 +1037,7 @@ begin
|
|||||||
$FF21..$FF3A: Result:=u+32;
|
$FF21..$FF3A: Result:=u+32;
|
||||||
else Result:=u;
|
else Result:=u;
|
||||||
end;
|
end;
|
||||||
end;
|
end; }
|
||||||
|
|
||||||
function UTF8LowerCase(const AInStr: utf8string): utf8string;
|
function UTF8LowerCase(const AInStr: utf8string): utf8string;
|
||||||
begin
|
begin
|
||||||
@ -1102,6 +1102,16 @@ begin
|
|||||||
|
|
||||||
// Major processing
|
// Major processing
|
||||||
case OldChar of
|
case OldChar of
|
||||||
|
$C380..$C39E: NewChar := OldChar + $20;
|
||||||
|
// $C39F: ß already lowercase
|
||||||
|
$C481..$C4B6: if OldChar mod 2 = 0 then NewChar := OldChar + 1;
|
||||||
|
//$C4B7: ĸ => K ?
|
||||||
|
$C4B8..$C588: if OldChar mod 2 = 1 then NewChar := OldChar + 1;
|
||||||
|
//$C589 ʼn => ?
|
||||||
|
$C58A..$C5B7: if OldChar mod 2 = 0 then NewChar := OldChar + 1;
|
||||||
|
$C5B8: NewChar := $C3BF; // Ÿ
|
||||||
|
$C5B9..$C8B3: if OldChar mod 2 = 1 then NewChar := OldChar + 1;
|
||||||
|
//
|
||||||
$CE91..$CE9F: NewChar := OldChar + $20; // Greek Characters
|
$CE91..$CE9F: NewChar := OldChar + $20; // Greek Characters
|
||||||
$CEA0..$CEA9: NewChar := OldChar + $E0; // Greek Characters
|
$CEA0..$CEA9: NewChar := OldChar + $E0; // Greek Characters
|
||||||
$D090..$D09F: NewChar := OldChar + $20; // Cyrillic alphabet
|
$D090..$D09F: NewChar := OldChar + $20; // Cyrillic alphabet
|
||||||
@ -1139,7 +1149,7 @@ begin
|
|||||||
end; // while
|
end; // while
|
||||||
|
|
||||||
// Final correction of the buffer size
|
// Final correction of the buffer size
|
||||||
SetLength(Result,OutCounter);
|
SetLength(Result,OutCounter-1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function UTF8UpperCase(const AInStr: utf8string): utf8string;
|
function UTF8UpperCase(const AInStr: utf8string): utf8string;
|
||||||
@ -1207,14 +1217,14 @@ begin
|
|||||||
case OldChar of
|
case OldChar of
|
||||||
// Latin Characters 0000–0FFF http://en.wikibooks.org/wiki/Unicode/Character_reference/0000-0FFF
|
// Latin Characters 0000–0FFF http://en.wikibooks.org/wiki/Unicode/Character_reference/0000-0FFF
|
||||||
$C39F: NewChar := $5353; // ß => SS
|
$C39F: NewChar := $5353; // ß => SS
|
||||||
$C3A0..$C3BD: NewChar := OldChar - $20;
|
$C3A0..$C3BE: NewChar := OldChar - $20;
|
||||||
$C3BE: NewChar := $C5B8; // ÿ
|
$C3BF: NewChar := $C5B8; // ÿ
|
||||||
$C481..$C4B7: if OldChar mod 2 = 1 then NewChar := OldChar - 1;
|
$C481..$C4B6: if OldChar mod 2 = 1 then NewChar := OldChar - 1;
|
||||||
//$C4B7: ĸ => K ?
|
//$C4B7: ĸ => K ?
|
||||||
$C4B8..$C588: if OldChar mod 2 = 0 then NewChar := OldChar - 1;
|
$C4B8..$C588: if OldChar mod 2 = 0 then NewChar := OldChar - 1;
|
||||||
//$C589 ʼn => ?
|
//$C589 ʼn => ?
|
||||||
$C58A..$C5B7: if OldChar mod 2 = 1 then NewChar := OldChar - 1;
|
$C58A..$C5B7: if OldChar mod 2 = 1 then NewChar := OldChar - 1;
|
||||||
$C5B8: NewChar := $C3BE; // Ÿ
|
//$C5B8: // Ÿ already uppercase
|
||||||
$C5B9..$C8B3: if OldChar mod 2 = 0 then NewChar := OldChar - 1;
|
$C5B9..$C8B3: if OldChar mod 2 = 0 then NewChar := OldChar - 1;
|
||||||
//
|
//
|
||||||
$CEB1..$CEBF: NewChar := OldChar - $20; // Greek Characters
|
$CEB1..$CEBF: NewChar := OldChar - $20; // Greek Characters
|
||||||
@ -1303,7 +1313,7 @@ end;
|
|||||||
|
|
||||||
initialization
|
initialization
|
||||||
InternalInit;
|
InternalInit;
|
||||||
InitUnicodeTables;
|
// InitUnicodeTables;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user