Delphi World - ýòî ïðîåêò, ÿâëÿþùèéñÿ ñáîðíèêîì ñòàòåé è ìàëîäîêóìåíòèðîâàííûõ âîçìîæíîñòåé  ïî ïðîãðàììèðîâàíèþ â ñðåäå Delphi. Çäåñü âû íàéä¸òå ðàáîòû ïî ñëåäóþùèì êàòåãîðèÿì: delphi, delfi, borland, bds, äåëüôè, äåëôè, äýëüôè, äýëôè, programming, example, ïðîãðàììèðîâàíèå, èñõîäíûå êîäû, code, èñõîäíèêè, source, sources, ñîðöû, ñîðñû, soft, programs, ïðîãðàììû, and, how, delphiworld, áàçû äàííûõ, ãðàôèêà, èãðû, èíòåðíåò, ñåòè, êîìïîíåíòû, êëàññû, ìóëüòèìåäèà, îñ, æåëåçî, ïðîãðàììà, èíòåðôåéñ, ðàáî÷èé ñòîë, ñèíòàêñèñ, òåõíîëîãèè, ôàéëîâàÿ ñèñòåìà...
Ïåðåêîäèðîâàíèå

Ýòîò àëãîðèòì ïîçâîëÿåò ïåðåêîäèðîâàòü òåêñò. Ðåàëèçîâàíû êîäèðîâêè Windows-1251, KOI8-R, ISO-8859-5 è DOS. Êîäèðîâêà – ýòî òàáëèöà, â êîòîðîé óêàçàíî, íàïðèìåð, ÷òî ñèìâîë ïîä íîìåðîì 160 - ýòî ðóññêàÿ áóêâà "à", à ïîä íîìåðîì 150 – "Ö" è ò. ä. Êîäèðîâêè ðàçëè÷àþòñÿ íîìåðàìè ðóññêèõ áóêâ (êàê ðàñïîëàãàòü àíãëèéñêèå áóêâû äîãîâîðèëèñü). Ðàçíûå êîìïüþòåðû â Èíòåðíåòå èñïîëüçóþò ðàçíûå êîäèðîâêè. È ïîýòîìó, êîãäà ðóññêèé òåêñò èäåò ïî Èíòåðíåòó, åãî ìíîãîêðàòíî ïåðåêîäèðóþò.

Ýòîò àëãîðèòì îáåñïå÷èâàåò âûñîêóþ ñêîðîñòü ïåðåêîäèðîâàíèÿ áîëüøèõ îáúåìîâ äàííûõ.


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;

Ïðîåêò Delphi World © Âûïóñê 2002 - 2004
Àâòîð ïðîåêòà: ___Nikolay