Welcome Guest, Not a member yet? Register   Sign In
URL Helper function url_title not working for specific russian words like Размещение на основе самообслуживания
#1

[eluser]Unknown[/eluser]
Hi everyone,

For one of my codeignitor projects, i noticed that for some russian words the url_title function does not work correctly.
For example the russian word "Размещение на основе самообслуживания" it returns blank.


Regards

Vinay
#2

[eluser]ivantcholakov[/eluser]
I use may transliteration to ASCII of the title (in Bulgarian language) before passing it as an argument to the function url_title(). And I have just published a class for solving this problem - https://github.com/ivantcholakov/transliterate

Here is a test for your example in Russian:

Code:
$title = 'Размещение на основе самообслуживания';

$title_ascii = Transliterate::to_ascii($title, 'ru');
echo $title_ascii;
// Result: Razmeschenie na osnove samoobsluzhivaniya
echo '<br />';

$slug = url_title($title_ascii, '-', true);
echo $slug;
// Result: razmeschenie-na-osnove-samoobsluzhivaniya
echo '<br />';




Theme © iAndrew 2016 - Forum software by © MyBB