I have tried to save to UTF-8 and UTF-16. When I save to UTF-8 the program prints out garbage, with UTF-16 it doesn’t event start. I think that has to do with some invisible characters at the beginning but not sure.
I say this workaround but it’s something that I want to avoid as I will have several special characters and a lot of words with these special characters:
In what context are using different file encodings? Do you load text files into your app at runtime? Do you get the files in a download scenario? Are the files static in your app? Or is it the lua-files you are encoding?
(On a swedish mac, åäö prints perfectly directly from code…)
I will use these characters within the application as well. It’s a translation game and the words are taken from a database and if the word is “apple” a translation will come from the database as well which is “äpple” (Special character) and from the translation the program will find the appropriate images which represent that letters.
So for example the word apple will draw out images from a table and the “index” from that table are that letter so to get the five images I would draw from the table like this:
The data looks good in the database however I’m not retrieving the information from the database yet, right now I just set the word statically to “äpple”. Then the word is being shuffled and I try to get the letter image like this:
From what i can understand there is nothing that hinders you from having a more indirect connection between the letter and the image itself.
When you ask for the letter ä, it could return the filename"letter_ae.png" like a dictionary.
From my experience it is always safer to skip using special characters in file names, since you can never be completely sure how different devices and platforms will handle it.
In what context are using different file encodings? Do you load text files into your app at runtime? Do you get the files in a download scenario? Are the files static in your app? Or is it the lua-files you are encoding?
(On a swedish mac, åäö prints perfectly directly from code…)
I will use these characters within the application as well. It’s a translation game and the words are taken from a database and if the word is “apple” a translation will come from the database as well which is “äpple” (Special character) and from the translation the program will find the appropriate images which represent that letters.
So for example the word apple will draw out images from a table and the “index” from that table are that letter so to get the five images I would draw from the table like this:
The data looks good in the database however I’m not retrieving the information from the database yet, right now I just set the word statically to “äpple”. Then the word is being shuffled and I try to get the letter image like this:
From what i can understand there is nothing that hinders you from having a more indirect connection between the letter and the image itself.
When you ask for the letter ä, it could return the filename"letter_ae.png" like a dictionary.
From my experience it is always safer to skip using special characters in file names, since you can never be completely sure how different devices and platforms will handle it.