Search code examples
httpurlusability

How should I sanitize urls so people don't put 漢字 or á or other things in them?


How should I sanitize urls so people don't put 漢字 or other things in them?

EDIT: I'm using java. The url will be generated from a question the user asks on a form. It seems StackOverflow just removed the offending characters, but it also turns an á into an a.

Is there a standard convention for doing this? Or does each developer just write their own version?


Solution

  • The process you're describing is slugify. There's no fixed mechanism for doing it; every framework handles it in their own way.