From: riwu
…
The ? is actually character 233 (the exact character code the game uses).
Simba says that é is 195 but the UTF16 Table disagrees:
http://www.fileformat.info/info/unicode/char/e9/index.htmIn fact, it says that the plugin is 100% correct.. Since Java by default uses UTF16, you need to convert the chars to UTF16 encoding or from Latin-1 to UTF8.

See:

Works fine normally.. However, in Simba:

Not only is the characters in the string completely wrong, but it also isn't able to print them.. It's fine that Simba only supports UTF8 but it needs a conversion function.
Solution
@riwu:
So.. I've been forced to add a conversion to the GLX plugin:
https://github.com/Brandon-T/GLX/commit/fc9283352abc048df962ef1df1e61d170ef00943 is changed.
Usage:
{$DEFINE SMART}
{$I GLX/Setup.Simba}
Function glToWStr(Str: String): WideString;
var
I: Integer;
begin
SetLength(Result, Length(Str));
For I := 1 To Length(Str) Do
begin
Result[I] := Chr(Int16(Ord(Str[I])));
end;
end;
Function glToUTF8(Str: WideString): String;
var
L: Integer;
begin
Str := glToWStr(Str);
L := GLXUTF16ToUTF8(@Str[1], nil);
SetLength(Result, L - 1);
GLXUTF16ToUTF8(@Str[1], @Result[1]);
end;
Function glToUTF16(Str: String): WideString;
var
L: Integer;
begin
L := GLXUTF8ToUTF16(@Str[1], nil);
SetLength(Result, L - 1);
GLXUTF8ToUTF16(@Str[1], @Result[1]);
end;
var
Smart: TSmart;
t: TStringArray;
S: String;
begin
ClearDebug();
SetupGLX(Smart, 800, 600);
T := glCharsToText(glGetChars(IntToBox(286, 531, 511, 551)), 3);
S := glToUTF8(T[0]);
writeln(glToUTF8(T[0]) = 'Créer un compte gratuit');
writeln(T[0] = glToUTF16('Créer un compte gratuit'));
end.
Paired with SMART[7892]
True
True
Successfully executed.
That means that for
strings containing special characters, you must do A OR B:
a. Convert the returned string to UTF8 and compare.
b. Convert the compared string to UTF16 and compare.
Up to you.. Note: You don't have to do this for strings with characters in the range: 0 inclusive to 127 inclusive.