cassiosantos: Reference of the example in the documentation: https://www.mql5.com/en/docs/files/filewritestruct T
Perhaps you should read the manual. FileWriteStruct is only for binary files.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Goodnight, I'm creating a bot and I need to extract some information for analysis, so I'm trying to create a txt, or csv, or even bin file, whatever I can make it work to receive this information; everything seems to work fine, as stated in the documentation, however the generated file has characters that I don't understand. I believe the error is in the FileOpen() command flags, the generated file seems to be in unicode, however, even specifying the FILE_ANSI flags the problem persists. I then used an example code from the documentation to test the situation, and in the same way the result was an unreadable file. in the "file open flags" tab of the documentation, there is a caveat, "If a file is opened for reading as a text file (FILE_TXT or FILE_CSV), and at the beginning of the file a two-byte indication 0xff,0xfe is encountered, the encoding flag will be FILE_UNICODE, even if FILE_ANSI is specified." https://www.mql5.com/en/docs/constants/io_constants/fileflags I believe this is the problem this "double byte indication" prevents me from encoding to ANSI, however I don't know how to react to this. here below I leave the example that I adapted from the documentation that even specifying FILE_ANSI, I believe it still returns me a writing in UNICODE. Reference of the example in the documentation: https://www.mql5.com/en/docs/files/filewritestruct Thank you all for the attention,