Jump to content

Special swedish characters in Category link


Recommended Posts

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

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 by selectshop.at (see edit history)
Link to comment
Share on other sites

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 by selectshop.at (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...