LCL: added conversion functions for windows codepages

git-svn-id: trunk@14899 -
This commit is contained in:
mattias 2008-04-19 19:33:09 +00:00
parent e5afe6b193
commit 3e1f9d6859
2 changed files with 3393 additions and 22 deletions

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,7 @@ begin
Result:=Result+s[i]; Result:=Result+s[i];
if s[i]='''' then if s[i]='''' then
Result:=Result+''''; Result:=Result+'''';
RangeIsString:=true;
end else begin end else begin
if RangeIsString then if RangeIsString then
Result:=Result+''''; Result:=Result+'''';
@ -158,7 +159,7 @@ begin
// write table: unicode to char // write table: unicode to char
writeln(' case Unicode of'); writeln(' case Unicode of');
writeln(' 0..127: Result:=chr(Unicode);'); writeln(' 0..127: Result:=Unicode;');
i:=0; i:=0;
while i<256 do begin while i<256 do begin
s:=SortedTable[i]; s:=SortedTable[i];
@ -186,18 +187,18 @@ begin
dec(j); dec(j);
if j=0 then if j=0 then
writeln(' '+IntToStr(UniCode) writeln(' '+IntToStr(UniCode)
+': Result:='+ToStringConstant(chr(StrToTableIndex(s)))+';') +': Result:='+IntToStr(StrToTableIndex(s))+';')
else if UniCode=TableIndex then else if UniCode=TableIndex then
writeln(' '+IntToStr(UniCode)+'..'+IntToStr(UniCode+j) writeln(' '+IntToStr(UniCode)+'..'+IntToStr(UniCode+j)
+': Result:=chr(Unicode);') +': Result:=Unicode;')
else else
writeln(' '+IntToStr(UniCode)+'..'+IntToStr(UniCode+j) writeln(' '+IntToStr(UniCode)+'..'+IntToStr(UniCode+j)
+': Result:=chr(Unicode-'+IntToStr(UniCode-TableIndex)+');'); +': Result:=Unicode-'+IntToStr(UniCode-TableIndex)+';');
inc(i,j); inc(i,j);
end; end;
inc(i); inc(i);
end; end;
writeln(' else Result:='''';'); writeln(' else Result:=-1;');
writeln(' end;'); writeln(' end;');
// create SortedTable // create SortedTable