Or you can keep all your names the same in your code, but when you open an image use string.gsub to replace all char 190 with _, or replace “à” with “a” etc.
http://developer.anscamobile.com/reference/index/stringgsub
eg:
pajaro = display.newImage(strings.gsub(“pàjaro.png”, “à”, “_”)
This way you don’t need to manage two sets of names, just rename your image files themselves replacing any special characters. This also means if you allow the user to save files it’ll still work. For example if they take a picture and then you ask them the filename to save as. Basically if you don’t know the potential filename before hand this works better.
If you want to later display the correct name, without having to save a seperate translation table, then you might be better off using some form of encoding. For example chars > 128, for example 190 become _190.
You can use…
pajaro = display.newImage(strings.gsub(“pàjaro.png”, “à”, “_190”)
and on load, say after you grab the list of files from the filesystem:
real_name = strings.gsub(filename, “_190”, “à”)
You could take this further by actually getting the ascii code of the special character and creating the _190 bit dynamically, and the same backwards.
Its a bit of a hassle, but once you do it, it’ll always work for any filename.
Another alternative is to see if io handles these chars. If it does, make a copy of the image to /tmp as image1.png or something and load that copy. There’s some file copy code somewhere on the site. [import]uid: 8872 topic_id: 22084 reply_id: 87863[/import]