tarek.fellah Posted January 31, 2014 Share Posted January 31, 2014 I have a problem with module blocktopmenu, it displays category links with incorrect special characters (like this mr-parts.com/158-strålkastare-hö), it seems like it's an utf 8 encoding problem, i tried to see the link_rewrite attribute in the table ps_category_lang, it displays url link rewrite with swedish characters but they are correct without any problem. PS: i have product url rewriting links with swedish characters and it doesn't trigger any problem. Prestashop 1.5.5. Thanks in advance. Link to comment Share on other sites More sharing options...
NemoPS Posted February 1, 2014 Share Posted February 1, 2014 Blocktopmenu.php Tools::HtmlEntitiesUTF8($category_link) There is your problem, remove or change this at about line 680 1 Link to comment Share on other sites More sharing options...
selectshop.at Posted February 1, 2014 Share Posted February 1, 2014 (edited) Furthermore your database should have set by default as charset UTF-8. If not please change with phpMyAdmin to avoid problems with other scripts. And add this too to your php.ini if you have rights for to change the charset of your server. If not you can also try to add this line to your shop .htaccess just as first line: AddDefaultCharset utf-8 Edited February 1, 2014 by selectshop.at (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted February 1, 2014 Share Posted February 1, 2014 As he says other category links work I assume that one is the issue, as it's the only difference in the link output compared to the normal category link Link to comment Share on other sites More sharing options...
selectshop.at Posted February 1, 2014 Share Posted February 1, 2014 (edited) Other problem of prestashop is that to avoid problem with other languages, some special characters were simply not rewritten. Automatically when you add a product or category on your back-office the meta-url is re-written into human readable code. For to use this automatic re-write option you should add to your file on FTP js/admin.js about line 391 the missing special characters. I give you an example for German characters ä, ö, ü, please search the UTF-8 collation for the characters on link below: str = str.replace(/[\u00E6\u00E4\u00C4]/g,'ae') str = str.replace(/[\u0153\u00F6\u00D6]/g,'oe'); str = str.replace(/[\u00FC\u00DC]/g,'ue'); Don't use this code, cause it is for German characters !! You will find a unicode list here: http://en.wikipedia.org/wiki/List_of_Unicode_characters Table Latin-1 - Character Å (Latin Capital letter A with ring above) = unicode \u00c5 = your code to add str = str.replace(/[\u00C5]/g,'A') Edited February 1, 2014 by selectshop.at (see edit history) Link to comment Share on other sites More sharing options...
tarek.fellah Posted February 1, 2014 Author Share Posted February 1, 2014 (edited) Blocktopmenu.php Tools::HtmlEntitiesUTF8($category_link) There is your problem, remove or change this at about line 680 Thank you Nemo1, that's solved the problem Edited February 1, 2014 by tarek.fellah (see edit history) Link to comment Share on other sites More sharing options...
tarek.fellah Posted February 1, 2014 Author Share Posted February 1, 2014 Is there an SEO problem with special characters included in URLs? Link to comment Share on other sites More sharing options...
NemoPS Posted February 1, 2014 Share Posted February 1, 2014 Well, google still recommends not to use them, but it's up to you in the end Link to comment Share on other sites More sharing options...
Recommended Posts