Memo.LoadFromFile(file.txt) does not work if file contains german characters (ä,ö,ü,ß etc.)
Original Reporter info from Mantis: WD
-
Reporter name: WD
Original Reporter info from Mantis: WD
- Reporter name: WD
Description:
If i try to load a german textfile (*.txt or *.csv) with special german characters like ü, ä, ö or ß in it in a TMemo (Form1.Memo1.Lines.LoadFromFile(textfile.txt);) there's nothing displayed and Lines.Count gives back "0" - so the Memo still seems to be empty.
If i copy the same text from Windows-Editor into the Memo by using the Clipboard the text is displayed with all special characters.
I can save the text and reload ist by Lines.LoadFromFile.
Loading a text without german characters works fine.
Steps to reproduce:
I take a Form like Form1
I paint a TMemo, a button and an OpenDialog-Symbol on it
The button has the function:
if Form1.OpenDialog1.Execute = TRUE then
begin
if FileExists(Form1.OpenDialog1.Filename) = TRUE then
begin
Form1.Memo1.Lines.LoadFromFile(Form1.OpenDialog1.Filename);
end else
begin
ShowMessage('File does not exist!');
end;
end;
I select a *.txt File using german characters like ä, ö, ü ... made with any Windows-Program that creates Textfiles (DATEV-GDPdU-Export-Function, Editor etc.)
The Loading-Process finishes without any Exception or Error-Message.
Nothing is displayed in the Memo and a lines.Count-Function gives the result = 0.
Additional information:
If you have a solution for that i will thank you very much :-).
Mantis conversion info:
- Mantis ID: 12676
- OS: Windows Vista
- OS Build: Windows Vista
- Build: 19.11.2008
- Platform: Windows Vista
- Version: 0.9.27 (SVN)