Cyrillic links

For articles specific to version 5.x
Post Reply
aivo
Posts: 2
Joined: Sun Oct 25, 2009 4:43 am

Cyrillic links

Post by aivo »

Who can help.
After switching options [Search Engine Friendly URLs: Yes, enable search engine ..] displayed in such a way
/products/%D0%9D%D0%BE%D1%83%D1%82%D0%B1%D1%83%D0%BA-ASUS-K40IN-%5B90NVNA3192A33LGC106F%5D.html
or
/categories/%D0%9D%D0%BE%D1%83%D1%82%D0%B1%D1%83%D0%BA%D0%B8/%D0%9D%D0%BE%D1%83%D1%82%D0%B1%D1%83%D0%BA%D0%B8-ASUS/
or
/pages/%D0%A2%D0%BE%D0%B2%D0%B0%D1%80%D1%8B.html
How to bring them into normal form?
/products/Noutbuk-ASUS-K40IN-[90NVNA3192A33LGC106F].html
or
/products/title product/SKU.html
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Cyrillic links

Post by Painstik »

I am nor sure yet is this everything you need to do, but i tested and yet everything works ok.

Open: lib/general.php

Find:

Code: Select all

	function MakeURLSafe($val)
   {
      $val = str_replace("-", "%2d", $val);
      $val = str_replace("+", "%2b", $val);
      $val = str_replace("+", "%2b", $val);
      $val = str_replace("/", "%2f", $val);
      $val = urlencode($val);
      $val = str_replace("+", "-", $val);
Add after (example for Croatian char č - %C4%8D):

Code: Select all

$val = str_replace("%C4%8D", "c", $val);
Find:

Code: Select all

   function MakeURLNormal($val)
   {
Add after:

Code: Select all

      $val = str_replace("c", "%C4%8D", $val);
This is example for Croatian char č, so you will need to find "code" for every cyrilic char you are using and replace it with latin ones like this.
Need custom coding for Interspire Shopping Cart? Contact me
CharlieFoxtrot
Confirmed
Confirmed
Posts: 413
Joined: Sun Aug 09, 2009 1:23 pm

Re: Cyrillic links

Post by CharlieFoxtrot »

Is there a flaw with that? ~ I haven't tested it... but in your example, it seems very likely that a normal 'c' might be converted in error.

Perhaps this isn't an issue and I'm just finding problems where none exist... but I thought I'd point it out anyway.
ISC 4.0.7

"... and let's be honest that whole "by design" thing is getting old too."
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Cyrillic links

Post by Painstik »

No, normal c is not converting in to %C4%8D (as the descritpion said "Convert an already search engine friendly based string back to the normal text equivalent.")

That was my fisrt worry too when I did that, and everything works good.
Need custom coding for Interspire Shopping Cart? Contact me
aivo
Posts: 2
Joined: Sun Oct 25, 2009 4:43 am

Re: Cyrillic links

Post by aivo »

where you can see the conversion table Cyrillic?
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Cyrillic links

Post by Painstik »

i don't know, type one by one cirillyc letter on some product, and in address bar copy that letter code, or use google :)
Need custom coding for Interspire Shopping Cart? Contact me
Post Reply