2

I'm currently developing a site in Joomla, and one of the components I'm using makes use of a PHP file to administer the language. (english.php, spanish.php)

The problem I'm having is that if I use the plain text version of eg. "á", it will show up in the browser tab title ok, but as a in the body of the page. But if I use a character reference (á), the reverse happens!

Any ideas?

Thanks

bren

Gumbo
  • 643,351
  • 109
  • 780
  • 844
Bren
  • 51
  • 5
  • 1
    So a title like `á` will be displayed as `�`? – Gumbo May 03 '10 at 14:43
  • 1
    Veículos is displaying as "Veículos" edit.. just by typing that i see the problem.. its parsing the 'í' as 'í' and therefore not seeing the whole code.. but i still am not sure how to fix this.. – Bren May 03 '10 at 16:01

1 Answers1

1

Couple of things:

  • Use htmlentities function for your text

    $my_text = htmlentities($string, ENT_QUOTES, 'UTF-8');

More info about the htmlentities function.

  • Use proper document type, this did the trick for me.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  • Use utf-8 encoding type in your page:

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Sarfraz
  • 377,238
  • 77
  • 533
  • 578
  • 1
    i've got the doctype set as html5 and the charset and utf-8. from what i can see it seems that its not parsing the { as seen but as &#123; .. – Bren May 03 '10 at 18:34