The result is not wrong. You must decide if you want an ASCII/ANSI file or a Unicode file.
You did not specify the format when you create the file, so it defaulted to a UTF format, with a Byte Order Mark (BOM) header at the beginning of the file.
If you want an ASCII or ANSI file, then specify it and the codepage when you create the file in MQL5.
EDIT: Alternatively have Python read it as Unicode or auto-detect. I don't use Python so don't know how that is done.
The result is not wrong. You must decide if you want an ASCII/ANSI file or a Unicode file.
You did not specify the format when you create the file, so it defaulted to a UTF format, with a Byte Order Mark (BOM) header at the beginning of the file.
If you want an ASCII or ANSI file, then specify it and the codepage when you create the file in MQL5.
EDIT: Alternatively have Python read it as Unicode or auto-detect. I don't use Python so don't know how that is done.
thank you very much !
your advice works for me
my python gives right value when i change :
int handle=FileOpen("file.txt",FILE_WRITE|FILE_TXT);
to :
int handle=FileOpen("file.txt",FILE_WRITE|FILE_TXT|FILE_ANSI);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
and in python: