Paullette Schwartz
Paullette Schwartz

Reputation: 31

odd issue with funny characters in Joomla/ Jomsocial

I hope someone can help me with this issue. For a few months (since last August) there has been an ongoing issue on my site with strange characters appearing all over the place - especially in user generated content.

I have searched and searched for answers but nothing ever seems to work, although the most pressing (in the blog component) has been resolved by setting JCE to validate HTML - which is does fine in the Blogging component (EasyBlog) but doesn't anywhere else (where it is less critical but still an issue).

Here is what I have done so far:

  1. Checked the site from multiple machines, multiple browsers - no difference.
  2. Checked the MySQL database and table collation - which are utf8_general_ci
  3. Added AddDefaultCharset UTF-8 and AddCharset UTF-8 .php to the .htaccess files. I played about with these for ages and these two seemed to be the only combination which didn't crash the site.
  4. Have checked the HTML headers and they definitely have the correct content encoding types (set to UTF-8)
  5. I have tried different WSIWIG editors to no avail. Besides it is often in the code output where the characters appear - typically a A next to a »

I have tried a hack to force the connection script to UTF-8 but this causes the site to crash.

If anyone has any ideas at all as to what I can do still ... I'm all ears (please)

Many thanks in advance

Upvotes: 0

Views: 2052

Answers (1)

Craig
Craig

Reputation: 9330

If your server is running PHP 5.4+ I would suggest that you try the following solution described in the JCE forums:

In the Editor Global Configuration, set "Entity Encoding" to "UTF-8"

In the "Custom Configuration Variables" field, add:

keep_nbsp:0

The keep an eye out for the JCE 2.3.2 release which will address this issue.

Things to note:

  1. anywhere the spurious â or  is occurring will have to be edited to remove the characters (once the changes above have been applied to JCE).
  2. the problem is Joomla! 2.5.x's use of get_html_translation_table() which relies on default values and PHP 5.4 changed the default encoding parameter to UTF-8. Previously it defaulted to ISO-8859-1

  3. For the core you could try and modify _decode() in /libraries/joomla/filter/input.php, look for the line (around 644):

    $trans_tbl = get_html_translation_table(HTML_ENTITIES);

and change it to:

$trans_tbl = get_html_translation_table(HTML_ENTITIES, ENT_COMPAT, 'ISO-8859-1');

Upvotes: 2

Related Questions