AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

OEM to ANSI mit Delphi 8

Ein Thema von Samashy · begonnen am 20. Feb 2004 · letzter Beitrag vom 25. Feb 2004
Antwort Antwort
Benutzerbild von Samashy
Samashy

Registriert seit: 20. Feb 2004
Ort: Cottbus
127 Beiträge
 
Delphi 10.4 Sydney
 
#1

OEM to ANSI mit Delphi 8

  Alt 20. Feb 2004, 08:46
Ich bin von Delphi 7.0 auf Delphi 8 .NET umgestiegen... Nun stehe ich vor dem Problem,
dass das Umwandeln von Textfiles von OEM to ANSI nicht mehr funktioniert.


Kann mir jemand helfen???
  Mit Zitat antworten Zitat
Touchdown

Registriert seit: 17. Feb 2003
227 Beiträge
 
#2

Re: OEM to ANSI mit Delphi 8

  Alt 20. Feb 2004, 09:12
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!
function getallfornothing: TGoldesel;
begin
result := TGoldesel.create;
end;
  Mit Zitat antworten Zitat
Benutzerbild von Samashy
Samashy

Registriert seit: 20. Feb 2004
Ort: Cottbus
127 Beiträge
 
Delphi 10.4 Sydney
 
#3

Re: OEM to ANSI mit Delphi 8

  Alt 20. Feb 2004, 09:20
Ich habe ja schon gesucht, aber leider nur Varianten gefunden, die im Delphi 8 nichtgelaufen sind... Kannst Du mir bitte beim Suchen helfen?

Romy
  Mit Zitat antworten Zitat
Touchdown

Registriert seit: 17. Feb 2003
227 Beiträge
 
#4

Re: OEM to ANSI mit Delphi 8

  Alt 20. Feb 2004, 12:02
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.
function getallfornothing: TGoldesel;
begin
result := TGoldesel.create;
end;
  Mit Zitat antworten Zitat
Benutzerbild von Samashy
Samashy

Registriert seit: 20. Feb 2004
Ort: Cottbus
127 Beiträge
 
Delphi 10.4 Sydney
 
#5

Re: OEM to ANSI mit Delphi 8

  Alt 24. Feb 2004, 11:12
Leider komme ich jetzt erst wieder dazu zu antworten...
Leider hilft der Code mir auch nicht.

10659990100511822601B”hme

So wäre zum Beispiel die Zeile.

Hoffe jemand, kann mir helfen!

Romy
  Mit Zitat antworten Zitat
Hansa

Registriert seit: 9. Jun 2002
Ort: Saarland
7.554 Beiträge
 
Delphi 8 Professional
 
#6

Re: OEM to ANSI mit Delphi 8

  Alt 24. Feb 2004, 19:00
Der Code kommt mir bekannt vor, aber die Werte im CASE nicht. 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;
Gruß
Hansa
  Mit Zitat antworten Zitat
Benutzerbild von Samashy
Samashy

Registriert seit: 20. Feb 2004
Ort: Cottbus
127 Beiträge
 
Delphi 10.4 Sydney
 
#7

Re: OEM to ANSI mit Delphi 8

  Alt 25. Feb 2004, 12:22
Dankeschön, aber auch dass hat mein Problem nicht gelöst!!!!
  Mit Zitat antworten Zitat
roderich
(Gast)

n/a Beiträge
 
#8

Re: OEM to ANSI mit Delphi 8

  Alt 25. Feb 2004, 12:49
Einwurf am Rande: Kann es irgendwie mit WideChar in .net zusammenhängen ? Aber ehrlich keine Ahnung, nur eine Idee.

Roderich
  Mit Zitat antworten Zitat
Benutzerbild von Samashy
Samashy

Registriert seit: 20. Feb 2004
Ort: Cottbus
127 Beiträge
 
Delphi 10.4 Sydney
 
#9

Re: OEM to ANSI mit Delphi 8

  Alt 25. Feb 2004, 12:55
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!


Danke für Eure Hilfe!!!

Romy
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:29 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