Azeem
Azeem

Reputation: 2924

Spanish characters are not displayed by browser

I need to support Spanish language for a website which I am developing. I have created an XML file which contains the english text and corresponding Spanish text. I am reading this XML file on user's choice (language dropbox). Everything is working fine unless there are some spanish characters which browser is not able to display properly.

enter image description here

The content of XML file is:

<Spanish>
    <title></title>
    <loginBoxHeader1>Login Panel -</loginBoxHeader1>
    <loginBoxHeader2>Por favor, proporcione las credenciales siguientes!</loginBoxHeader2>
    <username>Nombre de Usuario:</username>
    <password>Contraseña:</password>
    <LoginBtn>iniciar la sesión</LoginBtn>
    <RememberCheckbox>Recordar mi usuario en este equipo</RememberCheckbox>
</Spanish>

characters ñ and ó are not visible in browser. I set encoding of XML file to ISO-8859-1. Also I added following meta tag in HTML page:

<meta http-equiv="Content-Type" content="text/html; charset=ISO 8859-1">

I also tried with UTF-8 encoding but problem persists. Any thoughts?

Thanks.

Upvotes: 3

Views: 6398

Answers (4)

Jisha
Jisha

Reputation: 65

As @pawlakppp mentioned, have you checked the Encoding of your xml file. Try this -

  • Open the XML file in an editor like NOTEPAD++.
  • Go to 'Encoding' Menu
  • Click on 'Encofing with UTF-8' or 'Encoding with UTF-8 without BOM'.

Upvotes: 0

Chim
Chim

Reputation: 11

have you tried google fonts? http://www.google.com/fonts Click on "New to Google Fonts?" and follow the steps. I picked 1, just "Normal 400", followed the steps. I had the same problem, my spanish characters would show up as black diamonds with question marks on them.

Upvotes: 1

el vis
el vis

Reputation: 1302

Your page is decoded with utf-8 (but should in iso...), the reason can be:

  • page file itself is utf-8 encoded (in that case meta tags are ignored)
  • www server content-type header is utf-8 (and should be changed to iso...)

Or go other way and save xml in utf-8 using for example notepad++

Upvotes: 0

Adam Brown
Adam Brown

Reputation: 2870

Maybe the fonttype doesn't support the special characters? I have had the same problem before and it was just becuase the font didn't have the symbols in it. Changed the font and problem solved.

Upvotes: 0

Related Questions