Hi,
So please read this documentation for more info about Codepage constant it's explained as well.
https://docs.mql4.com/constants/io_constants/codepageusage
Regards!
![Use of a Codepage - Input/Output Constants - Standard Constants, Enumerations and Structures - MQL4 Reference Use of a Codepage - Input/Output Constants - Standard Constants, Enumerations and Structures - MQL4 Reference](https://c.mql5.com/36/19/use-of-a-codepage-input-output.png)
- docs.mql4.com
Hello,
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: 0
MQLInfoInteger(MQL_CODEPAGE) after codepage change: 0
Do you know what's wrong with the code??
using version 4.00 build 1090
thanks!!
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
CP_ACP |
0 |
The current Windows ANSI code page. |
When function MQLInfoInteger(MQL_CODEPAGE)will return any different code page than current windows code page?
![Use of a Codepage - Input/Output Constants - Standard Constants, Enumerations and Structures - MQL4 Reference Use of a Codepage - Input/Output Constants - Standard Constants, Enumerations and Structures - MQL4 Reference](https://c.mql5.com/36/20/use-of-a-codepage-input-output.png)
- docs.mql4.com
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 your the running code.
Why are you trying to change it ?
No, this is a property of specific MQL program, it can be changed according to the docs. Reasons for changing the codepage are explained.
![MQLSetInteger - Checkup - MQL4 Reference MQLSetInteger - Checkup - MQL4 Reference](https://c.mql5.com/36/20/mqlsetinteger-checkup-mql4-referenc.png)
- docs.mql4.com
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.
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
CP_ACP |
0 |
The current Windows ANSI code page. |
When function MQLInfoInteger(MQL_CODEPAGE)will return any different code page than current windows code page?
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.
You said:
MQLInfoInteger(MQL_CODEPAGE) gives you the codepage used by the terminal. You can't change by code...
This is incorrect.
You said:
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 ?
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.
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.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
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: 0
MQLInfoInteger(MQL_CODEPAGE) after codepage change: 0
Do you know what's wrong with the code??
using version 4.00 build 1090
thanks!!