Hey trading fellows,
As the title says,,, How do you guys compare a 'look-alike' string in ASCII to another one in Unicode?
Ive got this code generated by AI but it doesn't even work

. You can try running it & it will say "The 2 strings are different."
Thanks guys & have a good weekend.
As the title says,,, How do you guys compare a 'look-alike' string in ASCII to another one in Unicode?
Ive got this code generated by AI but it doesn't even work
Thanks guys & have a good weekend.
Inserted Code
//+------------------------------------------------------------------+
//| CompareStringsInASCIIandUNICODE.mq4 |
//| Copyright 2025, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
void OnInit(){
EventSetTimer(2);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason){
EventKillTimer();
}
//+------------------------------------------------------------------+
//| Timer function |
//+------------------------------------------------------------------+
void OnTimer(){
CompareItBuddy();
}
//////////////////////////////////////////////////
string AsciiToUnicode(uchar& ascii_chars[]){
string unicode_string = "";
for(int i = 0; i < ArraySize(ascii_chars); i++){
unicode_string += (string)ascii_chars[i];
}
return unicode_string;
}
void CompareItBuddy(){
string unicode_string_1 = "Hello, World!";
uchar ascii_chars_2[] = {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
// Convert the ASCII character array to a Unicode string
string unicode_string_2 = AsciiToUnicode(ascii_chars_2);
// Now compare the two Unicode strings
if(unicode_string_1 == unicode_string_2){
Print("The 2 strings are identical!");
}
else{
Print("The 2 strings are different.");
}
} ...want it most but use it worst!