XS script does not accept non-ASCII chars in strings

:arrow_forward: GAME INFORMATION

  • BUILD #: 43210
  • PLATFORM: Steam
  • OS: Windows 10

:arrow_forward: ISSUE EXPERIENCED

I want to send a chat to display a value. But if I use non-ASCII chars in a string(such as “×”, “√”, full-width chars, Chinese chars…), the Editor would return a msgbox with text:
Error 0047 "could not parse the code for '<function name>' function".
or
Error 0049 "could not emit quads for '<function name>' function".

Excamples that will cause error:

void chatValue_1()
{
    xsChatData("value = %d", 0);
}

or

void chatValue_2()
{
    xsChatData("值 = %d", 0);
}

:arrow_forward: FREQUENCY OF ISSUE

  • 100% of the time / matches I play (ALWAYS)

:arrow_forward: REPRODUCTION STEPS

  1. Create a MyCodeForTest.xs file in C:\Program Files\Steam\steamapps\common\AoE2DE\resources_common\xs
  2. Write these in .xs file:
void chatValue_1()
{
    xsChatData("value = %d", 0);
}
  1. Save as UTF-8.
  2. Create a new scenario in Editor. In “Map” tab, write “MyCodeForTest” in the “Script Filenam” input box.
  3. Switch to “Trigger” tab, create and select a trigger. Then a msgbox (Error 0047) displays.
    image
  4. Clear all text in .xs file, write these and save again:
void chatValue_1()
{
    xsChatData("value = %d", 0);
}
void chatValue_2()
{
    xsChatData("值 = %d", 0);
}
  1. Select a trigger. Then a msgbox (Error 0049) displays.
    image