Download

Convert UTF8 to ANSI Please!!!!

Hi, I’m working with an HTML5 project and I’m sending string through the browser javascript up to the game.
The problem is that I work with characters that have accents and the functions convert to UTF-8 and the accents come with the character of? in the engine. How could I convert to a format that displays the characters correctly.
below I will leave both functions … the one that converts in javascript and the one I get in C within my class.
A try search in web for functions to convert utf8 to ansi more no sucesfull… c++ error when build…

Browser Code



// Javascript Send Message To Unreal
function sendToUE(Chaine)
     {
        var str =  Chaine;
        var lenUTF8 = Module.lengthBytesUTF8(str) + 1;
        var ptr = Module._malloc(lenUTF8);
        Module.stringToUTF8(str, ptr, lenUTF8);
        Module.ccall('printString', 'null','string'], [str]);
        Module._free(ptr);
      }


C++ Code



// Request String from Browser (Javascript)
extern "C" void EMSCRIPTEN_KEEPALIVE printString(char *str)
{
    FString Msg(str);
    FOutputDeviceNull ar;
    ABrowserCommActor::MyBlueprint->ActualMsg = Msg;
}


I suggest you start here: Character Encoding | Unreal Engine Documentation

Hi, how did you manage to convert the charset, could you publish an example?