Autor Beitrag
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Fr 09.05.03 15:15 
Ich müsste aus einem normalen Pascal-String einen Unicode-String machen und vice versa. Daß bei den Pascalstrings die ganzen kyrillischen, chinesischen und sonstwie fremden Zeichen nicht richtig gespeichert werden, ist mir klar, mich interessiert erstmal der aSCII-Bereich, also das normale Alphabet mit Sonderzeichen. Das ganze müsste mit jeder Windows-Version funktionieren? ich habe schon bei unicode.org nachgeschaut, aber irgendwie finde ich da keine wirkliche Spezifikation für die Speicherform. Weiß jemand was darüber, gibt es OpenSource-Implementationen für Delphi oder kann mir jemand sonstige Tipps geben?

Danke
Thomas

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: Fr 09.05.03 15:39 
Unicode entspricht dem Delphi-Stringtyp WideString. Die Umwandlung ist ganz einfach:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
var
  s: string;
  ws: WideString;
begin
  s := 'Ein paar Umlaute: ÄäÖöÜü';
  ws := s; // Umwandlung nach Unicode durch Compiler Magic
end;


Es hapert nur mit der Ausgabe der Unicode Strings, denn die VCL ist nur für AnsiStrings ausgelegt. Aber es gibt die TNT Komponente die mit WideStrings arbeiten können.

_________________
Ist Zeit wirklich Geld?
tommie-lie Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Fr 09.05.03 15:47 
Danke für den Hinweis, aber war dummerweise ein Irrtum, hab' nämlich gerade gemerkt, daß es gar nicht am UniCode-System liegt :oops:
Der Post war vielleicht ein wenig vorschnell, aber ich habe wirklich keine andere Ursache für mein Problem gesehen.
Trotzdem danke, vielleicht brauch ich's ja doch nochmal.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert