Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

Categories

In this Discussion

Who's Online 19

CrusoeCurtisOdenconnectrhagu81peregrine +14 guests

testing friendly urls - Jönköping

This is a test
Tagged:

Comments

  • Posts: 54
    Resulting URL slug:
    testing-friendly-urls-j-nk-ping

    Looks bad :(
  • Posts: 521
    Prettier friendly URLs would be nice. Perhaps Url($Mixed) in library/core/class.format.php could be changed. Either changing the preg_replace line, or adding before it a str_replace with an array containing characters like "ö", and their replacements.

    Something like this (but with more complete arrays obviously)
    $bad = array("å", "ä", "á", "à", "ă", "â", "ö", "ø", "ó", "ò", "ŏ", "ô");
    $good = array("a", "a", "a", "a", "a", "a", "o", "o", "o", "o", "o", "o");
    $Mixed = str_replace($bad, $good, $Mixed);
    That way you'd get .../testing-friendly-urls-jonkoping which would look a lot friendlier.


    PHP has a function called iconv, specifically for converting between different character encodings, but it looks like you can't really rely on it working on all systems, so str_replace/strtr/preg_replace/etc would probably be safer.
  • Posts: 521
    Hah. And I found another discussion about this issue as well: http://vanillaforums.org/discussion/11334/non-url-friendly-characters-conversion-problem
Sign In or Register to comment.