I think it's too complicated for me to use properly MQLInfoInteger() - ot always return 0 for me.
For example: Print("MQLInfoInteger(MQL_CODEPAGE) on Init: ", MQLInfoInteger(MQL_CODEPAGE));MQLSetInteger(MQL_CODEPAGE, 850);Print("MQLInfoInteger(MQL_CODEPAGE) after codepage change: ", MQLInfoInteger(MQL_CODEPAGE)); gives the following output:MQLInfoInteger(MQL_CODEPAGE) on Init: 0MQLInfoInteger(MQL_CODEPAGE) after codepage change: 0
Do you know what's wrong with the code??
using version 4.00 build 1090
So please read this documentation for more info about Codepage constant it's explained as well.
MQLInfoInteger(MQL_CODEPAGE) gives you the codepage used by the terminal. You can't change by code, so it returns always the same value.
When you are using MQLSetInteger() it changes the codepage of your running code.
Why are you trying to change it ?
thanks. I have an issue with EA and Symbol(), _symbol and when running it on two different computers /win10 with different OS languages. Broker offers instruments with pound sign £. When I attach EA on chart, then no problem to OpenOrders but only if EA was compiled on the same machine. If I copy ex4 file to another machine I get 'unknown symbol' errror on order openning attempt beacuse of this pound sign. I don't want to compile twice (on 2 machines) so I thought I could use dynamic parameter and select code page that EA uses.
when run chcp command in windows I get the following response on 2 machines:Active code page: 852
Active code page: 850
https://docs.mql4.com/constants/io_constants/codepageusage says that
The current Windows ANSI code page.
When function MQLInfoInteger(MQL_CODEPAGE)will return any different code page than current windows code page?
When you are using MQLSetInteger() it changes the codepage your the running code.
No, this is a property of specific MQL program, it can be changed according to the docs. Reasons for changing the codepage are explained.
So ? I didn't say otherwise.
Even if you change it MQLInfoInteger(MQL_CODEPAGE) always returns the default codepage, it's all what I said.
MQLInfoInteger(MQL_CODEPAGE) gives you the codepage used by the terminal. You can't change by code...
This is incorrect.
This is not incorrect, your understanding of what I wrote is incorrect. That's means you can't change the codepage of Windows/Terminal, it's a deduction from the fact that MQLInfoInteger(MQL_CODEPAGE) always returns the same value even after you change it with MQLSetInteger(). Sorry if my formulation was not clear enough, but that doesn't really matter.
Do you have something useful to say to help the OP ?
I mean, OP did all correctly according to the documentation. If it does not work, then it's either the error in the documentation (and your deduction is correct), or there is a bug in the terminal, or terminal "thinks" both 850 and 852 are equal to default page, which results in 0 (and somewhat relates to the previous variant). I'm agree that 850/852 are not appropriate in Windows, and 1252 would be a better candidat, not 1250, as you suggested.
Apart from this we need more info from OP: exact windows versions and locale. Probably a short test code to play with.