Using Spanish Characters in Corona apps

Hey guys,
I am doing a translation of my app into spanish. The issue I am coming across is that when I have spanish characters such as the ñ or ó for example, the text in the app doesn’t display on device and on the windows simulator puts a ? graphic where those symbols are. Can anyone help me understand what I need to do to get spanish characters to display in my app? I am using a custom font, but even just using “Arial” I get the ? symbol where spanish characters should be. Any help would be appreciated, thanks!

PS. my custom font is “Chantelli Antiqua”, which I know for a fact supports all of the spanish characters except the upside down ! and ?. Where can I look to find fonts that support all the characters? [import]uid: 19620 topic_id: 35172 reply_id: 335172[/import]

I’ve done several apps that use Portuguese and Spanish and it works fine for me as long as the font supports them. It could be the editor that you’re using when you enter the characters too. Are you on a Mac or a PC? I’m not sure if that makes a difference but I’m on a Mac.

[import]uid: 199310 topic_id: 35172 reply_id: 139807[/import]

I have both a Mac and PC, but I am using Komodo Edit, I also have Notepad ++. I did copy and paste the translated text, so I think I will try hand typing it doing the spanish characters using the “alt” commands. I will report back. [import]uid: 19620 topic_id: 35172 reply_id: 139809[/import]

Komodo Edit should be okay, though I mostly use Sublime 2.
[import]uid: 199310 topic_id: 35172 reply_id: 139811[/import]

Still no luck, and in this case I am using “Arial” which I would think supports all those characters? Here is what it looks like…

http://www.bomtouch.com/images/example.png

Please click the link , couldn’t figure out how to display the image in the post. [import]uid: 19620 topic_id: 35172 reply_id: 139813[/import]

can you post a clip of your source?
[import]uid: 199310 topic_id: 35172 reply_id: 139816[/import]

sure,

[lua]–This is in a table that holds narrative text
M.narrative[1][1] = “600 años antes del nacimiento de Jesucristo, la ciudad de Jerusalén estaba llena de maldad. Muchos profetas de Dios testificaron a la gente de su iniquidad y la necesidad de arrepentírse.”

–And when the pages change I update my text object
mainText.text = storyText.narrative[global.thisStoryNumber][global.thisPageNumber][/lua] [import]uid: 19620 topic_id: 35172 reply_id: 139817[/import]

I did a little test cut an pasted your text into a main.lua file and it works like it supposed to.

--This is in a table that holds narrative text  
  
M = "600 años antes del nacimiento de Jesucristo, la ciudad de Jerusalén estaba llena de maldad. Muchos profetas de Dios testificaron a la gente de su iniquidad y la necesidad de arrepentírse."  
  
--And when the pages change I update my text object  
mainText = display.newText("",150,30,300,0,"Arial",20)  
mainText.text = M  
  
mainText.x = display.contentCenterX  
mainText.y = display.contentCenterY  

[import]uid: 199310 topic_id: 35172 reply_id: 139819[/import]

wow I’m not sure what to think then… I have exactly what you posted as my code and I still get those errors shown in the image I posted, not sure where to go from here =( [import]uid: 19620 topic_id: 35172 reply_id: 139820[/import]

What version of Corona are you running? [import]uid: 19620 topic_id: 35172 reply_id: 139827[/import]

I’m using 1007, but nothing has changed in string handling in a very long time. I would suspect that it’s your editor. At the bottom of your Komodo edit what do you see just to the left of the line and column number?

Does it say: Mac-Roman? If it does, click on it and change it to UTF-8 and save your file and see if that helps.
[import]uid: 199310 topic_id: 35172 reply_id: 139829[/import]

You were right rob! It was set to something strange… “CP1252”. No idea what that means but changing it to UTF-8 did the trick! Thank you so much [import]uid: 19620 topic_id: 35172 reply_id: 139830[/import]

I’ve done several apps that use Portuguese and Spanish and it works fine for me as long as the font supports them. It could be the editor that you’re using when you enter the characters too. Are you on a Mac or a PC? I’m not sure if that makes a difference but I’m on a Mac.

[import]uid: 199310 topic_id: 35172 reply_id: 139807[/import]

I have both a Mac and PC, but I am using Komodo Edit, I also have Notepad ++. I did copy and paste the translated text, so I think I will try hand typing it doing the spanish characters using the “alt” commands. I will report back. [import]uid: 19620 topic_id: 35172 reply_id: 139809[/import]

Komodo Edit should be okay, though I mostly use Sublime 2.
[import]uid: 199310 topic_id: 35172 reply_id: 139811[/import]

Still no luck, and in this case I am using “Arial” which I would think supports all those characters? Here is what it looks like…

http://www.bomtouch.com/images/example.png

Please click the link , couldn’t figure out how to display the image in the post. [import]uid: 19620 topic_id: 35172 reply_id: 139813[/import]

can you post a clip of your source?
[import]uid: 199310 topic_id: 35172 reply_id: 139816[/import]

sure,

[lua]–This is in a table that holds narrative text
M.narrative[1][1] = “600 años antes del nacimiento de Jesucristo, la ciudad de Jerusalén estaba llena de maldad. Muchos profetas de Dios testificaron a la gente de su iniquidad y la necesidad de arrepentírse.”

–And when the pages change I update my text object
mainText.text = storyText.narrative[global.thisStoryNumber][global.thisPageNumber][/lua] [import]uid: 19620 topic_id: 35172 reply_id: 139817[/import]

I did a little test cut an pasted your text into a main.lua file and it works like it supposed to.

--This is in a table that holds narrative text  
  
M = "600 años antes del nacimiento de Jesucristo, la ciudad de Jerusalén estaba llena de maldad. Muchos profetas de Dios testificaron a la gente de su iniquidad y la necesidad de arrepentírse."  
  
--And when the pages change I update my text object  
mainText = display.newText("",150,30,300,0,"Arial",20)  
mainText.text = M  
  
mainText.x = display.contentCenterX  
mainText.y = display.contentCenterY  

[import]uid: 199310 topic_id: 35172 reply_id: 139819[/import]

wow I’m not sure what to think then… I have exactly what you posted as my code and I still get those errors shown in the image I posted, not sure where to go from here =( [import]uid: 19620 topic_id: 35172 reply_id: 139820[/import]