I just want to note that, if someone has a native language like mine (hungarian), which uses a lot of accented letters, than slugify does everything but do not returns something "nice". Lots of dashes, not much to understand.
ie. had a post with the title: "A Reformáció Genfi Emlékműve Előtt",
slugify default returned: "a-reform-ci-genfi-eml-km-ve-el-tt"
remaccents + slugify: "a-reformacio-genfi-emlekmuve-elott"
I added in my code a remove accents function, which resolves the problem, and I thought maybe you could/want/may use it too
it's fairly simple, but had no problems with it yet:
- Code: Select all
* @desc remove accents from a given string
* @param string $string
* @param string $chC input char encoding
* @return string *
$string = iconv($chC,"ISO-8859-2",$string);
$string = strtr($string,
$string = iconv("ISO-8859-2",$chC,$string);
the only problem with it that it converts everything to ISO-8859-2 - which works for hungarian, but I do not know about other languages