Autor Beitrag
Hochhaus
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: Di 11.12.12 13:18 
Hallom allerseits !

ich habe ein Problem mit meinem TextEditor. Wenn ich abwechslungsweise den Text als Ansi und dann als Unicode und dann wieder als Ansi speichere, wird die Dateim langsam immer etwas grösser. Ist das wohl ein Problem vom Richedit, aus dem heraus ich speichere ?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
       If CodeX = 'Unicode' Then
               RichEdit1.Lines.SaveToFile(S, TEncoding.Unicode);
        If CodeX = 'ANSI' Then
               RichEdit1.Lines.SaveToFile(S, TEncoding.ANSI);


Danke für jede Antwort !

Hochhaus
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 11.12.12 14:19 
RTF ist nun einmal nicht gerade ein kleines Format, aber woran das liegt, kannst du nur durch einen Vergleich der gewachsenen Datei mit der vorher kleineren herausfinden. ;-)

Für diesen Beitrag haben gedankt: Hochhaus
Hochhaus Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: Di 11.12.12 15:23 
Eine gute und logische Idee ! Genau das werde ich tun.


Hochhaus
Hochhaus Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: Di 11.12.12 18:20 
Wie ich gesehen habe, werden in der neuen Datei willkürlich Leerzeilen eingefügt. Ich habe nichts anderes getan, als einmal die Datei unter "Ansi"-Codierung zu speichern, dann als Unicode und wieder als Ansi. Die Dateigrösse hat von 2020666 Byte auf 2020830 Byte zugenommen. Zahlreiche Leerzeilen wurden eingefügt. Beilagen: Diff.TXT, 11.TXT und 22.TXT.
Ich will Euch nicht zu viel Arbeit aufgeben - aber vielleicht sieht jemand sofort, was los ist - und ich bin "blind".

Danke,

Hochhaus
Einloggen, um Attachments anzusehen!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 11.12.12 18:46 
Für Quelltexte ein RichEdit? :shock: Na, wenn du meinst...

Ja, jedenfalls kann ich das reproduzieren. Woran es liegt, kann ich so direkt nicht sagen, es reicht jedenfalls schon die Datei zu laden und direkt wieder zu speichern, das hat gar nichts mit Unicode zu tun.

Für diesen Beitrag haben gedankt: Hochhaus
Hochhaus Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: Di 11.12.12 18:56 
Ich habe versuchsweise eine kleinere Datei geladen. Dort gab es keinerlei Probleme. Die grosse Datei hatte ich am Kommandozeilenprompt zusammenkopiert mit dem Befehl " COPY 1.TXT + 1.TXT + 1. TXT 2.TXT". Dabei wird jeweils ein EOF-Marker mithineinkopiert. Könnte das das Problem verursachen ?

Hochhaus
Gerd Kayser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 632
Erhaltene Danke: 121

Win 7 32-bit
Delphi 2006/XE
BeitragVerfasst: Do 13.12.12 02:36 
user profile iconHochhaus hat folgendes geschrieben Zum zitierten Posting springen:
Die grosse Datei hatte ich am Kommandozeilenprompt zusammenkopiert mit dem Befehl " COPY 1.TXT + 1.TXT + 1. TXT 2.TXT". Dabei wird jeweils ein EOF-Marker mithineinkopiert.

Der Copy-Befehl hat einen Schalter "/b". Wenn man diesen benutzt, dann wird auch nichts hinzugefügt,

Für diesen Beitrag haben gedankt: Hochhaus