Welcome Guest, Not a member yet? Register   Sign In
Special characters and spaces in url?
#1

[eluser]Emrys[/eluser]
Hey all

Does anyone know why this would throw a disallowed characters error? : /gallery/John%20Pérez

This works : /gallery/John%20Perez, so I know it's not the % sign. His real name is John Pérez.

I'd love to just add the 'é' to the permitted_uri_chars expression, but anything I tried has failed. Does anyone know how to add a foreign character to that list?

thanks
Marc
#2

[eluser]Emrys[/eluser]
ok I mostly figured it out. Adding \xE9 to the permitted_uri_chars doesn't work, but adding it to the preg_match() in Router.php does work. So I'll just create a subclass and do it myself in there.

It's not elegant, but it works for now Smile.

M
#3

[eluser]Nick Husher[/eluser]
That's not a very friendly URL, perhaps transforming John Pérez into "/gallery/john_perez" would be more straightforward. Unless you have a problem with colliding URLs (a John Pérez and a John Perez in the same system), it's better for SEO and user accessability to simplify your URL into sematic characters as much as possible.
#4

[eluser]Emrys[/eluser]
oh hey, I just noticed the forum messed up the code Smile. The url is actually : /gallery/John%20P% E 9 rez (without spaces of course).
Still not very friendly, I agree.. but better than the one posted up there. Having said that however, I think I should look further into rewriting that.

thanks
M




Theme © iAndrew 2016 - Forum software by © MyBB