Improve UTF-8 character handling in Atlas
(Also prevents the compile-time warnings reported in the abandoned D1432)
Accepted by: Itms
Patch linting by: Stan, Vladislav, wraitii
Also tested by: Imarok
Fixes: #4936
Differential Revision: https://code.wildfiregames.com/D1395