• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spanish in array not displaying correctly on page


Below is the Spanish array I am using, attached to the post is a screen shot of the result. Page is UTF-8, Spanish characters display properly in the text, just not when passed through this array. Any thoughts how to fix?

$list = array(
                    'NL'=>'Países Bajos',
                    'UK'=>'Reino Unido',
                    'US'=>'Estados Unidos de América');

Definitely an encoding issue, I'm not sure at what point it's getting mixed up, but are you able to use html entities for the special characters? http://www.w3schools.com/tags/ref_entities.asp

Joel on Software has a good article btw about encodings in case you ever have trouble sleeping http://www.joelonsoftware.com/articles/Unicode.html

Tried the htmlentities, this function only allows string, not array. However, I used your link, replaced text with the appropriate code.. and wallah! Looks good, thank you!!

Another solution.

$config['charset'] = "UTF-8";

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
&lt;html &gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;My Title&lt;/title&gt;    

Try it.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.