MadOwl Posted October 8, 2016 Share Posted October 8, 2016 Hello! I have a problem, friends: I use Phaser text objects in my game: game.add.text(... My way of implementing game localization is the simplest possible way: I just store strings like var locString_testString = 'test string' in a separate .js files. When I use English, everything is fine. But when I change 'test string' to something like "ぽ", weird stuff (check the attachment) is displayed. My files are in UTF-8. I checked docs, but didn't find anything according to locale/localization. Maybe some of you faced the same problem? I will appreciate any help! Mentalinks 1 Link to comment Share on other sites More sharing options...
mattstyles Posted October 8, 2016 Share Posted October 8, 2016 It's likely to do with the font not supporting the characters you're trying to use. Try it with a font you know supports the character and see if you still have problems. MadOwl 1 Link to comment Share on other sites More sharing options...
charlie_says Posted October 8, 2016 Share Posted October 8, 2016 I agree with @mattstyles suggestion, but on a recent project I was involved with the localisation issue arose because Excel wouldn't export some characters correctly to CSV. I ended up creating the files in OpenOffice which seemed to edit the text file (CSV in this case) "raw". MadOwl 1 Link to comment Share on other sites More sharing options...
MadOwl Posted October 8, 2016 Author Share Posted October 8, 2016 Thanks for your advices! I'll try different fonts today and will post the results here. Link to comment Share on other sites More sharing options...
MadOwl Posted October 8, 2016 Author Share Posted October 8, 2016 So, I tried different fonts (including weird ones like MS Gothic) and it didn't help. I also tried to use Spanish word (quién): Which fonts do you guys use? Link to comment Share on other sites More sharing options...
MadOwl Posted October 9, 2016 Author Share Posted October 9, 2016 I am digging this... Just noticed a strange behaviour: when I use \u1321 code symbols, sometimes it works: if my localization file contains 死, Phaser fails to display it. If I use something like \u1231, it displays a right letter. It seems it's an encoding problem. Hell. Link to comment Share on other sites More sharing options...
MadOwl Posted October 10, 2016 Author Share Posted October 10, 2016 Solved! Damn. I've added '<meta charset="utf-8">' to my .html file...And now everything works fine! drhayes and Mentalinks 2 Link to comment Share on other sites More sharing options...
mattstyles Posted October 10, 2016 Share Posted October 10, 2016 Well done solving it, thats bound to catch someone else out at some point too Link to comment Share on other sites More sharing options...
Mentalinks Posted January 26, 2017 Share Posted January 26, 2017 On 10.10.2016 at 5:39 AM, MadOwl said: Solved! Damn. I've added '<meta charset="utf-8">' to my .html file...And now everything works fine! Thanks man, that solved my problem too. Link to comment Share on other sites More sharing options...
Recommended Posts