You are here:  » Enocding problem

Support Forum



Enocding problem

Submitted by IG on Mon, 2013-04-01 16:48 in

Hi David

I am running the latest pricetapestry distribution on a new site

I have set the character set in config.php to utf-8 and everything looked fine until I realised that there is a strange encoding problem.

Case 1:
- When I translate "Price search results for" in translate.php to German "Preisvergleich für" the German Umlaut "ü" shows on the website and in the source code as � (question mark with black background);
- Example URL: {link saved}

Case 2:
- When I translate "Product reviews for" in translate.php to German "Produktbewertungen für" the German Umlaut "ü" shows on the website correctly as "ü", but in the meta description in the source code as "& amp;uuml;" (without the space after "&"), which is not the way it should be
- Example URL: {link saved}

I am looking forward to receiving your guidance how to solve this problem.

Kind regards,
IG

Submitted by support on Tue, 2013-04-02 08:31

Hello IG,

Regarding Case 1, it looks like all that's happened is that your includes/translate.php has been edited / saved in ISO-8859-1 encoding, instead of UTF-8 in order to be compatible with the encoding of your site (I see that datafeed data is appearing fine, so UTF-8 is definitely the $config_charset value to use.

However, there is no HTML encoding of the translated text in the meta description in reviews.php, so I wonder if the "ü" is entity encoded directly in includes/translate.php.

The first thing I would recommend doing, is open includes/translate.php in your text editor, make an arbitrary change (e.g. add then delete a space), then use File > Save As and on the Save As dialog, look to see if there is a character encoding drop down. If there is, select UTF-8 NO-BOM (if exists) or just UTF-8 otherwise. BOM means "byte order marking" which can cause problems if present in PHP scripts.

Once re-saved, copy the "ü" from the Case 1 translation into the Case 2 translation and then re-save, and that should do the trick.

If it's still appearing strange, please email me the file and I'll check it out for you on my test server.

Cheers,
David.
--
PriceTapestry.com

Submitted by IG on Tue, 2013-04-02 19:15

Hello David

I followed your instructions and now everything looks the way it is supposed to look. I am still a bit puzzled tough as this problem has never occurred to me before.

Thanks again for your help. You are a star!

Cheers,
IG