Download MetaTrader 5

Libraries: Base64

To add comments, please log in or register
Track all payments in your profile. It is easy!
MetaQuotes Software Corp.
Moderator
181395
MetaQuotes Software Corp. 2008.07.01 08:26 

Base64:

Simple coding/decoding of entries in Base64.

Author: Renat Fatkhullin

MQL4 Comments
16319
MQL4 Comments 2008.09.22 21:20  

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 2009.08.28 09:15  
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 2012.06.13 10:02  
your code is working fine for me. Thank you!
tradeomatic
15
tradeomatic 2016.09.23 15:44  

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