views:

33

answers:

2

Hey folks,

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

A: 

Had some of the same issues: http://stackoverflow.com/questions/2298204/php-remove-identify-this-symbol

Phill Pafford
A: 

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"&gt;

  • Use utf-8 encoding type in your page:

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

Sarfraz
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 { ..
Bren