Delphi FAQ -

| | | | | |
| | | | | | |



Google  
 

ANSI, KOI8-R, KOI8-U, OEM-DOS, ISO



: VEG

{ **** UBPFD *********** by delphibase.endimus.com ****
>>       
ANSI, KOI8-R, KOI8-U, OEM/DOS, ISO

     ,    
  ,       .
      ConvertEncoding,
      ,  
,     -  , 
         .

    6    ( TCodeMatrix):
1. cmAnsiToKoi8R -     ANSI   KOI8-R
2. cmAnsiToKoi8U -     ANSI   KOI8-U
3. cmKoi8RToAnsi -     KOI8-R   ANSI
4. cmKoi8UToAnsi -     KOI8-U   ANSI
5. cmOemDosToAnsi -     OEM/DOS   ANSI
6. cmIsoToAnsi -     ISO   ANSI

: System;
:       VEG, veg@tut.by,   - 
Copyright:   VEG, 31.10.2003
:        31  2003 .
***************************************************** }

type //   
  TCodeMatrix = array[1..255] of char;
const //  
  FirstCodes =
    #1#2#3#4#5#6#7#8#9#10#11#12#13#14#15#16#17#18#19#20#21#22#23#24#25#26#27#28+
   #29#30#31' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^' +
    '_`abcdefghijklmnopqrstuvwxyz{|}~';
  cmAnsiToKoi8R: TCodeMatrix = FirstCodes // ver 1.0, VEG, 31.10.2003
  + ' '
    + '';
  cmAnsiToKoi8U: TCodeMatrix = FirstCodes // ver 0.8, VEG, 31.10.2003
  + ' '
    + '';
  cmKoi8RToAnsi: TCodeMatrix = FirstCodes // ver 1.0, VEG, 31.10.2003
  + '--L-++T++------?v??? ???=-㬬LLL---TTT+++'
    + '';
  cmKoi8UToAnsi: TCodeMatrix = FirstCodes // ver 1.0, VEG, 31.10.2003
  + '--L-++T++------?v??? ???=-㳿LLL-T+'
    + '';
  cmOemDosToAnsi: TCodeMatrix = FirstCodes // ver 1.0, VEG, 31.10.2003
  + '---+---L+T+-+L'
    + 'T=+TTLL-++-----v ';
  cmIsoToAnsi: TCodeMatrix = FirstCodes // ver 1.0, VEG, 31.10.2003
  + '??????????????????????????????? '
    + '';

function ConvertEncoding(sIn: string; sCoding: string): string;
//sIn -   
//sCoding -   
//result -   
var
  iFtd: integer;
begin
  for iFtd := 1 to length(sIn) do
    result := result + sCoding[ord(sIn[iFtd])];
end; // ver 1.0, (C)Vrublevsky Evgeny Gennadyevich (BELARUS/SLUTSK), 31.10.2003

:

var
  sOut: string;
begin
  sOut := ConvertEncoding(ConvertEncoding('!', cmAnsiToKoi8R), cmKoi8RToAnsi);
end;





Copyright 2004-2016 "Delphi Sources". Delphi World FAQ




     Twitter     Facebook