FusePowered

Using Spanish Characters in Corona apps

11 replies [Last post]
rxmarccall
User offline. Last seen 8 weeks 4 days ago. Offline
Joined: 18 Jan 2011

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?

Replies

Rob Miracle
User offline. Last seen 20 hours 38 min ago. Offline
Staff
Joined: 26 Nov 2012

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.

rxmarccall
User offline. Last seen 8 weeks 4 days ago. Offline
Joined: 18 Jan 2011

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.

Rob Miracle
User offline. Last seen 20 hours 38 min ago. Offline
Staff
Joined: 26 Nov 2012

Komodo Edit should be okay, though I mostly use Sublime 2.

rxmarccall
User offline. Last seen 8 weeks 4 days ago. Offline
Joined: 18 Jan 2011

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.

Rob Miracle
User offline. Last seen 20 hours 38 min ago. Offline
Staff
Joined: 26 Nov 2012

can you post a clip of your source?

rxmarccall
User offline. Last seen 8 weeks 4 days ago. Offline
Joined: 18 Jan 2011

sure,

1
2
3
4
5
--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]

Rob Miracle
User offline. Last seen 20 hours 38 min ago. Offline
Staff
Joined: 26 Nov 2012

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

1
2
3
4
5
6
7
8
9
10
--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

rxmarccall
User offline. Last seen 8 weeks 4 days ago. Offline
Joined: 18 Jan 2011

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 =(

rxmarccall
User offline. Last seen 8 weeks 4 days ago. Offline
Joined: 18 Jan 2011

What version of Corona are you running?

Rob Miracle
User offline. Last seen 20 hours 38 min ago. Offline
Staff
Joined: 26 Nov 2012

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.

rxmarccall
User offline. Last seen 8 weeks 4 days ago. Offline
Joined: 18 Jan 2011

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

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.