*

MB Themes

Re: ERORR in formating PHP for cyrilic
« Reply #15 on: June 28, 2021, 02:34:56 PM »
@Ivanko
Once again, it's wrong, as objective of whole this is to optimize URL and make it more friendly for search engines, adding ', '', # or ## into URL is WRONG. I am pretty sure that # is completely illegal character in URL as it is used for hash.

Following mapping has been used.
Code: [Select]
    $cyr = array('А','а','Б','б','В','в','Г','г','Ґ','ґ','Д','д','Ђ','ђ','Е','е','Ё','ё','Ж','ж','З','з','З́','з́','И','и','Й','й','Ѝ','ѝ','І','і','Ї','ї','Ј','ј','К','к','Л','л','Љ','љ','М','м','Н','н','Њ','њ','О','о','Ō','ō','П','п','Р','р','С','с','С́','с́','Т','т','Ћ','ћ','Ќ','ќ','У','у','Ӯ','ӯ','Ў','ў','Ф','ф','Х','х','Ц','ц','Ч','ч','Џ','џ','Ш','ш','Щ','щ','Ъ','ъ','Ы','ы','Ь','ь','Э','э','Ю','ю','Я','я');
    $lat = array('A','a','B','b','V','v','G','g','Gj','gj','D','d','Dz','dz','E','e','Jo','jo','Zh','zh','Z','z','Z','z','I','i','J','j','J','j','J','j','J','j','J','j','K','k','L','l','Lj','lj','M','m','N','n','Nj','nj','O','o','O','o','P','p','R','r','S','s','S','s','T','t','T','t','Kj','kj','U','u','U','u','U','u','F','f','H','h','C','c','Ch','ch','Dzh','dzh','Sh','sh','Shh','shh','','','Y','y','','','Je','je','Ju','ju','Ja','ja');

That means some characters will be skipped from URL completely.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on June 28, 2021, 03:43:17 PM
*

Ivanko

  • *****
  • 388 posts
Re: ERORR in formating PHP for cyrilic
« Reply #16 on: June 28, 2021, 02:51:44 PM »
@Ivanko
Once again, it's wrong, as objective of whole this is to optimize URL and make it more friendly for search engines, adding ', '', # or ## into URL is WRONG. I am pretty sure that # is completely illegal character in URL as it is used for hash.

Following mapping has been used.
Code: [Select]
    $cyr = array('А','а','Б','б','В','в','Г','г','Ґ','ґ','Д','д','Ђ','ђ','Е','е','Ё','ё','Ж','ж','З','з','З́','з́','И','и','Й','й','Ѝ','ѝ','І','і','Ї','ї','Ј','ј','К','к','Л','л','Љ','љ','М','м','Н','н','Њ','њ','О','о','Ō','ō','П','п','Р','р','С','с','С́','с́','Т','т','Ћ','ћ','Ќ','ќ','У','у','Ӯ','ӯ','Ў','ў','Ф','ф','Х','х','Ц','ц','Ч','ч','Џ','џ','Ш','ш','Щ','щ','Ъ','ъ','Ы','ы','Ь','ь','Э','э','Ю','ю','Я','я');
    $lat = array('A','a','B','b','V','v','G','g','Gj','gj','D','d','Dz','dz','E','e','Jo','jo','Zh','zh','Z','z','Z','z','I','i','J','j','J','j','J','j','J','j','J','j','K','k','L','l','Lj','lj','M','m','N','n','Nj','nj','O','o','O','o','P','p','R','r','S','s','S','s','T','t','T','t','Kj','kj','U','u','U','u','U','u','F','f','H','h','C','c','Ch','ch','Dzh','dzh','Sh','sh','Shh','shh','','','Y','y','','','Je','je','Ju','ju','Ja','ja');

That means some characters will be skipped from URL completely.

OK, somewhere you are right, then lets instead of mapping ## for letter Ъ just use an empty space ''

Capital Ъ = ''
Small ъ = ''

same can be used for
Ь = ''
ь = ''

Probably it will the best solution, I am using it many years.


Finally
Code: [Select]
// update cyrilic to latin
$cyr = array('А','а','Б','б','В','в','Г','г','Ґ','ґ','Д','д','Ђ','ђ','Е','е','Ё','ё','Ж','ж','З','з','З́','з́','И','и','Й','й','Ѝ','ѝ','І','і','Ї','ї','Ј','ј','К','к','Л','л','Љ','љ','М','м','Н','н','Њ','њ','О','о','Ō','ō','П','п','Р','р','С','с','С́','с́','Т','т','Ћ','ћ','Ќ','ќ','У','у','Ӯ','ӯ','Ў','ў','Ф','ф','Х','х','Ц','ц','Ч','ч','Џ','џ','Ш','ш','Щ','щ','Ъ','ъ','Ы','ы','Ь','ь','Э','э','Ю','ю','Я','я','є');
$lat = array('A','a','B','b','V','v','G','g','Gj','gj','D','d','Dz','dz','E','e','Jo','jo','Zh','zh','Z','z','Z','z','I','i','J','j','J','j','J','j','J','j','J','j','K','k','L','l','Lj','lj','M','m','N','n','Nj','nj','O','o','O','o','P','p','R','r','S','s','S','s','T','t','T','t','Kj','kj','U','u','U','u','U','u','F','f','H','h','C','c','Ch','ch','Dzh','dzh','Sh','sh','Shh','shh','','','Y','y','','','Je','je','Ju','ju','Ja','ja','je');
« Last Edit: June 28, 2021, 03:13:35 PM by Ivanko »

*

MB Themes

Re: ERORR in formating PHP for cyrilic
« Reply #17 on: June 28, 2021, 03:43:11 PM »
Sounds good, thanks for help ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots