You are here:  » Danish letters not working


Danish letters not working

Submitted by KristianT on Thu, 2012-11-08 21:45 in

Sorry to bother you again David.

I just imported the first feed, and the description contains danish letters, in the pricetapestry installation it´s working fine, but in Joomla the letters do not show correct. Is it a problem with Joomla plugin or is it my settings in Joomla?

Regards
Kristian

Submitted by support on Fri, 2012-11-09 11:25

Hi Kristian,

That will be a character encoding issue; most likely that your feed data is iso-8859-1 (and Price Tapestry configured to be using $config_charset = "iso-8859-1") however your Joomla site is being output as UTF-8.

I'm investigating the details of modifying the Joomla character set as it doesn't appear to be configurable, please bear with me and I'll post an update shortly.

Cheers,
David.
--
PriceTapestry.com

Submitted by support on Fri, 2012-11-09 12:34

Hi Kristian,

I will make this configurable, in the mean time, to change the character set, if you can edit the file plugins/system/plg_pto_system/plg_pto_system.php and add the following code to the end of the file, just before the closing PHP tag:

JFactory::getDocument()->setCharset("iso-8859-1");

Cheers,
David.
--
PriceTapestry.com

Submitted by KristianT on Fri, 2012-11-09 21:31

Sorry David, but do not work :(

Regards
Kristian

Submitted by support on Sat, 2012-11-10 09:39

Hi Kristian,

Sorry about that; could you perhaps post en example URL (I'll remove before publishing your reply) showing characters being incorrectly displayed; plus if possible a link to the same product page within the associated Price Tapestry installation so that I can compare and I'll check it out for you...

Thanks!
David.
--
PriceTapestry.com

Submitted by KristianT on Sun, 2012-11-11 15:05

Sure David.

{links saved}

Regards
Kristian

Submitted by support on Mon, 2012-11-12 10:30

HI Kristian,

Thanks - i've checked it all out and the solution is as follows;

Firstly, your feed is actually UTF-8; so in the first instance, if you could switch your Price Tapestry configuration back to UTF-8 (if not already) by changing line 4 in config.php as follows:

  $config_charset = "utf-8";

Now the main fix is actually to ensure that the Price Tapestry installation is using the same SET NAMES call to the database as Joomla, so to do this, edit your Price Tapestry includes/database.php and insert the following code at the end of the file, on the line before the closing PHP tag:

  database_queryModify("SET NAMES 'utf8'",$result);

Next, re-import your feed.

Finally, I made some changes to the plugin files to make sure that only htmlspecialchars is used in place of the full htmlentities; which actually breaks the display in some cases of UTF-8 characters whereas they are displayed correctly and with no problems without.

This fix is now in the distribution, so if you could download and update the plugin files (no need to delete or uninstall, the plugin will udpate files so all your configuration is saved) and that should do the trick!

Cheers,
David.
--
PriceTapestry.com

Submitted by KristianT on Mon, 2012-11-12 10:58

Awesome David, got it working now :)
Thanks

Regards
Kristian