Tech-Ecke / Delphi Inhalt / ASCII zu ANSI und zurück

 

     Von ASCII nach ANSI und zurück

 
const MaxLength = 255; // maximale Länge  der Zeichenkette
var
     ASCII, ANSI: String;
     PText, AText : PChar;
 
begin
  ASCII := ('„”á');
  PText:=StrAlloc(MaxLength);
  StrPCopy(PText,AText);    // von ANSI zu ASCII    CharToOEM(PText,PText); {32Bit}
  {$IFDEF WIN32}
  OEMToChar(PText,PText); {32Bit}
  {$ELSE}
  OEMToAnsi(PText,PText); {16Bit}   // von ANSI zu ASCII    AnsiToOEM(PText,PText); {16Bit}
  {$ENDIF}
  ANSI := StrPas(PText);
  StrDispose(PText);
end;
 

Die Option Drucken funktioniert erst ab Netscape V4.0 bzw. I-Explorer 5.0 !

[letzte Aktualisierung 09.10.2006]