You are here:  » Special character encoding problem


Special character encoding problem

Submitted by nanaz on Wed, 2013-10-30 15:19 in

Hi David,

I have one feed that won't display properly in Joomla 2.5.14. It displays correctly in the standalone version of PT. The Joomla site is UTF-8.
I've tried everything you've mentioned at other topics in the forum, but it just won't work.
The feed is fetched as UTF-8 but the special characters show ë instead of ü, é instead of é etc.

I used the 'encode UTF-8' filter but then it only gets worse. For example: é is displayed as é.

Can you help me? Thank you!

kind regards,
Marlies

Submitted by support on Wed, 2013-10-30 15:25

Hello Marlies, and welcome to the forum!

This is normally down to a mis-match in collation between the Joomla (or WordPress) tables, and the Price Tapestry tables. It is easily resolved with a modification to the collation of the Price Tapestry tables for which I have a dbmod script and patch, which I will email to you very shortly...

Cheers,
David.
--
PriceTapestry.com

Submitted by nanaz on Wed, 2013-10-30 16:16

Thanks for your fast response!
Everything works great now, except the title on the product page, that's the only field that doesn't display correctly.

Submitted by support on Wed, 2013-10-30 16:26

Hi Marlies,

Please try this - in plugins/system/plg_pto_system/pto_product.php look for the following code at line 377:

$html_product = str_replace("%PRODUCT_NAME%",htmlentities($product->name,ENT_QUOTES),$html_product);

...and REPLACE with:

$html_product =
  str_replace("%PRODUCT_NAME%",htmlentities($product->name,ENT_QUOTES,"utf-8"),$html_product);

If you're not sure of course, let me know and I'll forward a patched file for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by nanaz on Thu, 2013-10-31 07:37

Hi David,

I made the adjustment in the plugin, but nothing changes... The product title (and following also the meta title, keywords, description) are still wrong encoded.

with kind regards,
Marlies

Submitted by support on Thu, 2013-10-31 09:41

Hello Marlies,

Would it be possible to let me know an example product page URL (i'll remove before publishing your reply), and also the filename of the feed containing that product and I'll grab the feed from your /feeds/ folder and check it out on my test server for you...

Thanks,
David.
--
PriceTapestry.com

Submitted by nanaz on Thu, 2013-10-31 12:23

Hi David,

Of course! The site is hidden, could you PM me your IP address so I can add it to the htaccess as being allowed?

Thank you!

Submitted by support on Thu, 2013-10-31 13:38

Hello Marlies,

I'll be on a fixed IP later on but I fetched the feed to my test server and was able to replicate the problem - it's a double-entity encoding issue, easily resolved. In the file components/com_pto/pto.php look for the following code at line 181:

  $title = str_replace("%PRODUCT_NAME%",htmlentities($pto_productName,ENT_QUOTES),$title);

...and REPLACE with just:

  $title = str_replace("%PRODUCT_NAME%",$pto_productName,$title);

Cheers,
David.
--
PriceTapestry.com

Submitted by nanaz on Thu, 2013-10-31 14:54

David, you're the best! Now everything is just as it should be :-)
I will make a note of it for further installments

Thank you & kind regards,
Marlies