![]() |
OEM to ANSI mit Delphi 8
Ich bin von Delphi 7.0 auf Delphi 8 .NET :lol: umgestiegen... Nun stehe ich vor dem Problem,
dass das Umwandeln von Textfiles von OEM to ANSI nicht mehr funktioniert. Kann mir jemand helfen??? :( |
Re: OEM to ANSI mit Delphi 8
OEMTOANSI und Co. kannste dir selber nachbauen. Musst mal hier in der DP danach suchen.
Ist ein 10 Zeiler, recht simpler aber wirklich effektiver Code! |
Re: OEM to ANSI mit Delphi 8
:cry: Ich habe ja schon gesucht, aber leider nur Varianten gefunden, die im Delphi 8 nichtgelaufen sind... Kannst Du mir bitte beim Suchen helfen? :hi:
Romy |
Re: OEM to ANSI mit Delphi 8
OEMTOANSI behandelt nur Sonderzeichen, diese Methode übernimmt ganau dies:
Delphi-Quellcode:
Musst einfach mal testen, sollte aber gehen.
function SetSonderzeichen(s: string): string;
var i: integer; begin Result := ''; for i := 1 to Length(s) do begin case s[i] of #142: Result := Result + #196; //Ä #153: Result := Result + #214; //Ö #154: Result := Result + #220; //Ü #132: Result := Result + #228; //ä #148: Result := Result + #246; //ö #129: Result := Result + #252; //ü #225: Result := Result + #223; //ß else Result := Result + s[i]; end; end; end; |
Re: OEM to ANSI mit Delphi 8
Leider komme ich jetzt erst wieder dazu zu antworten...
Leider hilft der Code mir auch nicht. :cry: 10659990100511822601B”hme So wäre zum Beispiel die Zeile. Hoffe jemand, kann mir helfen! Romy |
Re: OEM to ANSI mit Delphi 8
Der Code kommt mir bekannt vor, aber die Werte im CASE nicht. :mrgreen: Probiere mal das:
Delphi-Quellcode:
function AnsiToAscii(s: string): string;
var i: integer; begin Result := ''; for i := 0 to Length(s) do begin case s[ii] of #196: Result := Result + #142; //Ä #214: Result := Result + #153; //Ö #220: Result := Result + #154; //Ü #228: Result := Result + #132; //ä #246: Result := Result + #148; //ö #252: Result := Result + #129; //ü #223: Result := Result + #225; //ß else Result := Result + s[i]; end; end; end; |
Re: OEM to ANSI mit Delphi 8
Dankeschön, aber auch dass hat mein Problem nicht gelöst!!!! :cry:
|
Re: OEM to ANSI mit Delphi 8
Einwurf am Rande: Kann es irgendwie mit WideChar in .net zusammenhängen ? Aber ehrlich keine Ahnung, nur eine Idee.
Roderich |
Re: OEM to ANSI mit Delphi 8
Okay, eben habe ich des Rätsels Lösung! Der erste 10Zeiler war schon der richtige. Leider hat der Dateiersteller sich beim ö etwas vertan und dort ein völlig anderes Zeichen eingefügt. Die restlichen Buchstaben hatten schon gestimmt und ich habe immer an dem BÖHME festgeklebt!
:bounce2: Danke für Eure Hilfe!!!:dancer2: Romy |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:45 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz