Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kahrl
Created July 4, 2015 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kahrl/50669c6beaf57fe1796e to your computer and use it in GitHub Desktop.
Save kahrl/50669c6beaf57fe1796e to your computer and use it in GitHub Desktop.
1. User types stuff into chat formspec. At this point it is stored as a core::stringw inside irrlicht.
2. User submits the form. guiFormSpecMenu.cpp converts the text to utf8 for submitting it as a formspec field.
3. Since this is the chat formspec, code in game.cpp intercepts the formspec submission.
4. game.cpp:186 calls narrow_to_wide on the string.
Result: a utf8 string is interpreted as a narrow string for conversion to wide string.
--> on Linux: no effect because narrow == utf8
--> on Windows: BOOM, narrow means CP_ACP, not CP_UTF8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment