I’m a bit lost as to how to support foreign languages in my game. Specifically, I have global highscores database where players can input their names. But I don’t want people spamming the database with weird characters that can’t be rendered.
Is there a way to limit the type of characters accepted to a standard English set? Otherwise I need to use a font that supports thousands of foreign characters, which doesn’t seem practical.
Well, actually I DO have the option to create a large fontmap texture with EZGUI to support quite a lot of Unicode characters. But I’m trying to conserve resources.
I just tried the ASCII idea but it looks no different than the default keyboard, and all the Latin Extended characters are still inputable. Moreover, if I have an international keyboard set up, I’m free to enter anything I want, including Chinese – which I just tried doing.
Hey I come up against this a bit,
With my next game I’m removing a few things because I don’t want them to break with international characters. Just wondering how people get around it?
It would be cool if you could somehow use the iPhones internal font…
just realized that I am going to have the same issue in my game,
I’m using Gamecenter user names/leaderboards, but rendering them in my own Gui so that I can add extra info next to each player’s name. (also I dont need to worry about swear filtering usernames as it should be taken care of by Apple already)
But I just thought… Apple probably allows game-center names with foreign character symbols… so I am also going to get screwed by this issue in foreign countries.
I could try only rendering characters in the font, or swap them out for * but that isn’t very acceptable either… hmmmmm
You could simply not release it to asian and arrabic markets, then you can use a full ASCII font which will easily work for iOS and render it completely fine. If you make an additional font map for russian then you can cover that too
Why not simply validate the user input with regular expressions? Then it doesn’t really matter what type of font you use and what market you aim at since you can specifiy which kind of characters you want to support.
I disabled some languages/regions in iTunes connect. (in the live version)
added a max string length clip, as those unknown characters annoyingly multiply up to make the string longer… I think it substitutes 1 bad character for 4 ???
added a full ascii font
However its still a problem… even printing with the full ascii font… it still replaces all the french/german characters with ??? as if the font does not include the extra characters… but I see them there in the font texture… do you have any idea why that might be ? are there any unity settings to enable these characters? (the font is set to unicode mode)
note:- it is definitely using the new ascii font, as it looks different from my standard font…
I am just using GUI.label to display, and the ascii unicode font is in a GuiStyle.
I am getting the text from GameCenter leader board list of Alias Names.
Is there a special type of string or conversion I need to do to the strings ?