Autor Beitrag
G-McKree
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178



BeitragVerfasst: Mi 02.04.03 19:04 
Super, ich kann jez *.txt in ein TStringList laden (thx@Manfred), aber die *.txt Dateien müssen im ANSI-Format gespeichert sein, woraus sich für mich folgendes Problem ergibt: tschechische Schriftzeichen sind im ANSI-Format nicht darstellbar. Und somit frage ich euch: Wie kann ich mit TStringList Dateien Nicht-ANSI-Texte laden?
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Mi 02.04.03 19:15 
Willst du den Zeichensatz konvertieren? PSDK Stichwort "String Manipulation Functions". Das müsste man in eine Stringliste laden können, denke ich.

_________________
Life is a bad adventure, but the graphic is really good!
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Mi 02.04.03 19:22 
Hi
den Textdateien ist es vollkommen egal ob sie im ANSI oder Sonstwas-Format sind. Das Laden aus der Datei funktioniert also immer. Nur mit der Darstellung könnte es dann hapern.
Aber ich stell mir gerade die Frage wieso? Denn auch ein tschechisches Windows verwendet das ANSI-Format. Es geht also eher darum die Zeichen von einer länderspezifischen Zeichensatztabelle in eine andere zu konvertieren. Dafür gibt's glaube ich die API-Funktion LCMapString. Vielleicht wissen da unsere API-Gurus mehr dazu.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
G-McKree Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178



BeitragVerfasst: Mi 02.04.03 19:33 
aber mein deutsches winxP erlaubt mir ja nicht mal solche zeichen im ANSI-format zu speichern und bei anderen formaten schreibt delphi komische zeichen
G-McKree Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178



BeitragVerfasst: Mi 02.04.03 19:45 
jez hab ich mal versucht einen kurzem tschechischen satz per MS Word als .txt zu speichern, Word hat aber keine codierung parat, die delphi versteht. delphi mien nur was von ''raised fucking exception. could not oped file....bla bla...bla''
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Mi 02.04.03 19:52 
lade dir mal meinen Editor von meiner HP runder da gibt es eine funktion die wandelt Ansi zeichen nach Acci zeichen um, meinst du vileicht sowas ?

_________________
MFG
Michael Springwald, "kann kein englisch...."
G-McKree Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178



BeitragVerfasst: Mi 02.04.03 20:09 
mir ist eigendlich so ziemlich egal in welchem format die dateien sind. kann delphi auch was anderes als ANSI-text laden?
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Mi 02.04.03 20:16 
delphi kann "nur" Ansi standarrt gemäs...so viel wie ich weiß...

_________________
MFG
Michael Springwald, "kann kein englisch...."
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 03.04.03 08:38 
Hi
mimi hat folgendes geschrieben:
delphi kann "nur" Ansi standarrt gemäs...so viel wie ich weiß...

Nein, ob ANSI, ASCII, EBCDIC ist Delphi völlig wurscht. Laden kannst du es auf jeden Fall. Nur wenn du versuchst es darzustellen kriegst du ein Problem.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Do 03.04.03 18:57 
was ist denn EBCDIC ?
das kenn ich ja überhaupt nicht.

das meine ich ja auch "Nur da Stellen gibt es probleme"(hätte ich vileicht hinschreiben sollen ;))

_________________
MFG
Michael Springwald, "kann kein englisch...."
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: Do 03.04.03 19:36 
Die VCL kann nur ANSI-Text ausgeben. Unter WinNT/2000/XP und Win9x/ME mit MS Unicode Layer können auch den gesamten Unicode (UTF16) ausgeben. Dazu muss man unter Delphi jedoch die VCL umgehen, da diese z.B. TextOut/TextOutA anstatt TextOutW aufruft.

_________________
Ist Zeit wirklich Geld?
G-McKree Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178



BeitragVerfasst: Do 03.04.03 19:52 
AndyB hat folgendes geschrieben:
MS Unicode Layer

wo gibt´s das?


AndyB hat folgendes geschrieben:
die VCL umgehen, da diese z.B. TextOut/TextOutA anstatt TextOutW aufruft

und wie macht man das?
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Do 03.04.03 20:40 
Zitat:

MS Unicode Layer

was ist das denn ???

_________________
MFG
Michael Springwald, "kann kein englisch...."
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 03.04.03 21:00 
Hi
mimi hat folgendes geschrieben:
was ist denn EBCDIC ?
das kenn ich ja überhaupt nicht.

ASCII-Tabelle für'n Grossrechner.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Do 03.04.03 21:09 
und wie darfman sich sowas vorstellen ???
so eine Tabelle ???

_________________
MFG
Michael Springwald, "kann kein englisch...."
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 03.04.03 21:23 
mimi hat folgendes geschrieben:
und wie darfman sich sowas vorstellen ???
so eine Tabelle ???

Ist das jetzt ernst gemeint? Kopfkratz :shock:
Das ist die schlaue Tabelle in der drinsteht wie der PC jedes einzelne Zeichen zu kodieren hat, also 1 = &31, A = &41 usw.
EBCDIC ist genau das gleiche nur die Codierung der Zeichen ist eben anders angeordnet.

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Do 03.04.03 21:38 
Ich glaube des Pudels Kern ist das hier :

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
function AsciiToAnsi(s: string): string;
var
  i: integer;
begin
  Result := '';
  for i := 0 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;


Gilt aber nicht für China :!: :mrgreen:

_________________
Gruß
Hansa
G-McKree Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178



BeitragVerfasst: Do 03.04.03 21:39 
hat nu jemand ne idee, wie man tschechische schriftzeichen aus ner datei nach delphi laden kann?
G-McKree Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178



BeitragVerfasst: Do 03.04.03 21:42 
@hansa
hättest du noch ne erklärung, was das genau ist?
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Do 03.04.03 21:45 
Ach, Du bist echt in Prag ? :shock: Ich dachte, tschechisch wäre nur ein Beispiel. :lol: Ja dann geh doch hin und laß Dir mal mit ord (ch) den Ascii - Wert der Sonderzeichen anzeigen. Und dann halt wie im Beispiel das ganze in Ansi umsetzen.

_________________
Gruß
Hansa