:
band detail QRDBText. , 160 , , , ?
:
dbf- FoxPro8 ( ), _866 ( ), , dbf- Builder, - "", .
, , !
procedure tform1.button1click(sender: tobject);
var
code1, code2: tcode;
s: string;
c: char;
i: integer;
chars: array [char] of char;
str: array [tcode] of string;
begin
case combobox1.itemindex of
1: code1 := koi;
2: code1 := iso;
3: code1 := dos;
else code1 := win;
end;
case combobox2.itemindex of
1: code2 := koi;
2: code2 := iso;
3: code2 := dos;
else code2 := win;
end;
s := memo1.text;
str[win] := '';
str[koi] := '';
str[iso] := '';
str[dos] := ' "''""';
for c := #0 to #255 do
chars[c] := c;
for i := 1 to length(str[win]) do
chars[str[code2][i]] := str[code1][i];
for i := 1 to length(s) do
s[i] := chars[s[i]];
memo2.text := s;
end;
// Windows
char* Decode_DOS_to_Win(char * str)
{
unsigned char *cstr=str;//"unsigned" - -
for(; *cstr; cstr++)
{
if(*cstr>=128 && *cstr<=175)
*cstr+=64;
else
if(*cstr>=224 && *cstr<=239)
*cstr+=16;
else if(*cstr==252)
*cstr=185;
}
return str;
}
//----------------------------------------------------
// Windows
char* Decode_Win_to_DOS(char * str)
{
unsigned char *cstr=str;
for(;*cstr;cstr++)
{
if(*cstr>=240)
*cstr-=16;
else if(*cstr>=192)
*cstr-=64;
else
if(*cstr==185)
*cstr=252;
}
return str;
}
//----------------------------------------------------