Download MetaTrader 5

Error in compiler or in terminal display?

To add comments, please log in or register
hardhu
90
hardhu  

Hello,

I know that it is not such an important question, but:

this simple piece of code should print as output the "white heart suit" ♡ (hex code 2661);

 

void OnStart()
  {
    string test="";
   
   StringSetCharacter(test,0,0x2661);
   Print(test);
   }

 

 Instead what I get is the following displayed output:

 

Simon Gniadkowski
Moderator
18023
Simon Gniadkowski  
hardhu:

Hello,

I know that it is not such an important question, but:

this simple piece of code should print as output the "white heart suit" ♡ (hex code 2661);

What Font do you think that MT5 is using ?
hardhu
90
hardhu  
RaptorUK:
What Font do you think that MT5 is using ?

I don't know if it is only a font problem, in fact if I slightly change the code in this way: 

void OnStart()
  {
    string test="";
   
   StringSetCharacter(test,0,0x2661);
   Print(test);
   StringSetCharacter(test,1,0x2662);
   Print(test);
   }

 

 Then I get the correct symbol in the second print output.

 

 

Simon Gniadkowski
Moderator
18023
Simon Gniadkowski  
hardhu:

I don't know if it is only a font problem, in fact if I slightly change the code in this way: 

Mmmmm,  this might be a bug,  according to the Documentation . . .  "If pos is equal to string length, the specified symbol is added at the string end, and the length is enlarged by one."  

The reason I asked about character set is when I look at  Arial  in charmap I don't find the white heart suit at 0x2661 

Alain Verleyen
Moderator
32028
Alain Verleyen  
hardhu:

I don't know if it is only a font problem, in fact if I slightly change the code in this way: 

 

 Then I get the correct symbol in the second print output.

This is clearly a bug. You can write to ServiceDesk.
Get in touch with developers using Service Desk!
Get in touch with developers using Service Desk!
  • www.mql5.com
We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them.
To add comments, please log in or register