PDA

View Full Version : Using Special characters



kortovos
21 Dec 2010, 3:28 AM
The app I am making is multilangual. So when I tried the Spanish version today I got a surprise. Special characters like 'ë,é,à,...' are not displayed. Am I doing something wrong or is there a way around this?


alert('ë,ä,á,ç,à');

gkatz
21 Dec 2010, 4:13 AM
you probably have to use HTML entities instead

kortovos
21 Dec 2010, 4:23 AM
you mean things like : 'Ã'for 'Ã'.

Does anyone know why sencha has a problem with special characters?

aCa
21 Dec 2010, 11:03 AM
Have you saved your file with utf8?

kortovos
22 Dec 2010, 4:18 AM
What do you mean with 'saved your file with utf8'?

AndreaCammarata
23 Dec 2010, 5:41 AM
The app I am making is multilangual. So when I tried the Spanish version today I got a surprise. Special characters like 'ë,é,à,...' are not displayed. Am I doing something wrong or is there a way around this?


alert('ë,ä,á,ç,à');

Try to use Unicode characters.
Example:
Intead of write



alert('ëäáçà');
try this one


alert('\u00EB\u00E4\u00E1\u00E7\u00E0');
This should solve your issue.
I suggest you to take a look at this link to know the corrisponding code of your characters:
http://0xcc.net/jsescape/
Write your text in the "Plain Text" textbox and take the result from "\uXXXX" textbox.

Hope this helps

kortovos
23 Dec 2010, 5:50 AM
Thanks andreacammarata, your solution is the only one that I have tried that works (I have tried to change default char sets, override char sets,... and nothing worked).

AndreaCammarata
23 Dec 2010, 5:55 AM
You are welcome ;)

mobimike
6 Dec 2012, 1:25 AM
Helo Friends,
I am facing problem with Spanish special characters in placeholder. The special characters are getting displayed correctly in labels and other places however in placeholder, the code is getting displayed. For example "Información" is getting displayed as "Informaci&#243n". I tried replacing with UTF-8 codes but still not working. Any pointers are greatly appreciated.