UTF support in Monkey

Monkey Forums/Monkey Programming/UTF support in Monkey

anawiki(Posted 2011) [#1]
Does current Monkey version (v50+) has any support for UTF? We are doing DE, FR, ES, IT versions of our game and it looks like there are issues with files that use international characers (Monkey simply doesn't load them). We made a program that decodes those chars, but it is a bit of pain to workaround this issue, but may e we are doing something wrong.

Cheers
Rman


Hima(Posted 2011) [#2]
Yes, it does. I tried Japanese and it works perfectly fine with BMFont


anawiki(Posted 2011) [#3]
Really? What target? What do you use to create those UTF files?


Aman(Posted 2011) [#4]
The way monkey works is that it ASCII code for each character and print it if the bitmap font has that character in the same order it is intended to be. The default mojo font has only upto 127. If you want to support more characters, you will have to create a bitmap font with more characters. Fontmachine editor is the easiest way to do that. Or you can let take advantage of the target. I wrote native code that allows you to show an alert box with a message for xna and android. Using that you will see that android support any language if the bm font is long enough.*

*Except languages that require reshapers(the shape of the character depends on its position in the word)


anawiki(Posted 2011) [#5]
I know Monkey can draw those chars without issues using Angel Font or something like that. The problem is that LoadString seems to have issues with loading strings in UTF format (at least on iOS). Instead of real string it returns empty string (at least for me).


TMK(Posted 2011) [#6]
I'm using Unicode text files (UCS2 Little Endian) and LoadString works fine on those on iOS, returning correct characters for german etc., so perhaps LoadString requires Unicode and not UTF8 or something.


anawiki(Posted 2011) [#7]
Unicode is fine, I don't need UTF that much. How do I make Unicode files? That question makes me such a lame ;)


GfK(Posted 2011) [#8]
I've had this problem too with loadstring failing when loading certain characters under ios. Since that's the only way of loading raw data, the whole episode was a complete nightmare.

Considering alternatives to monkey for now. Too many gotchas.


TheRedFox(Posted 2011) [#9]
Why not base64 them out and unbase4 them in?
It would some most issues with Unicode storage in strings.


TMK(Posted 2011) [#10]
anawiki: I'm using Notepad++ (free!) to make Unicode and other text files. It shows the format of the text file and allows you to convert them between the formats easily etc. :)


Aman(Posted 2011) [#11]
I totally misunderstood you.
Regular notepad works fine with Unicode. That is what I am using. When saving the file, choose Encoding to be Unicode instead of ANSI


Hima(Posted 2011) [#12]
Wow, glad to know that the LoadString has problems before I decided to make a game on Monkey. The game I'm planning to do is a visual novel so it requires LoadString for dynamic scripting. I tried rendering Japanese and it works fine so I didn't investigate further. I'll see if it works with other languages as well, both in Unicode and UTF8