Download MetaTrader 5

Libraries: Base64

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
187224
MetaQuotes Software Corp.  

Base64:

Simple coding/decoding of entries in Base64.

Author: Renat Fatkhullin

MQL4 Comments
16319
MQL4 Comments  

This library is not correct. Try the following:

string s;

s = CharToStr(65);

s = s + CharToStr(0);

s = s + CharToStr(66);

// in s variable will be "AB" not "A\x00B" (without 0 byte in the middle)! Therefore this code can not be valid.

How can I concatenate zero char in string? I am using MT4 4.00 build 218.

 

Thank you,

Milan

MQL4 Comments
16319
MQL4 Comments  
milanull:

This library is not correct. Try the following:

string s;

s = CharToStr(65);

s = s + CharToStr(0);

s = s + CharToStr(66);

// in s variable will be "AB" not "A\x00B" (without 0 byte in the middle)! Therefore this code can not be valid.

How can I concatenate zero char in string? I am using MT4 4.00 build 218.

Thank you,

Milan

MQL4 Comments
16319
MQL4 Comments  
your code is working fine for me. Thank you!
tradeomatic
15
tradeomatic  

Thanks for this code, it's working nicely.

Is there any way to prevent the compile warnings? I'm seeing five occurrences of  'possible loss of data due to type conversion'.

Thanks. 

To add comments, please log in or register