Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Prism OEM to ANSI mit Delphi 8 (https://www.delphipraxis.net/16615-oem-ansi-mit-delphi-8-a.html)

Samashy 20. Feb 2004 08:46


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??? :(

Touchdown 20. Feb 2004 09:12

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!

Samashy 20. Feb 2004 09:20

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

Touchdown 20. Feb 2004 12:02

Re: OEM to ANSI mit Delphi 8
 
OEMTOANSI behandelt nur Sonderzeichen, diese Methode übernimmt ganau dies:

Delphi-Quellcode:
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;
Musst einfach mal testen, sollte aber gehen.

Samashy 24. Feb 2004 11:12

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

Hansa 24. Feb 2004 19:00

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;

Samashy 25. Feb 2004 12:22

Re: OEM to ANSI mit Delphi 8
 
Dankeschön, aber auch dass hat mein Problem nicht gelöst!!!! :cry:

roderich 25. Feb 2004 12:49

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

Samashy 25. Feb 2004 12:55

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 05:35 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz