cleaning article titles for URLs
| From: | Justin French | Date: | Tue, 27 Apr 2004 01:20:56 +0000 |
| Subject: | cleaning article titles for URLs | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-184712@lists.php.net to get a copy of this message | ||
I'm taking a user-supplied article title, and creating a search-engine and user friendly URL for that article. Obviously the titles need to be cleaned up and well-formatted (so no, urlencode() is not an option).
Currently I'm:
- converting it all to lowercase
- replacing spaces with underscores
- removing ?,&,#,%
- removing multiple underscores
But what I'm concerned about is other special characters, accented characters, etc.
- Are accented characters (eg cafè) allowed/safe in URLs?
- Would it be more appropriate to convert them down to ASCII (è > e, ü
u, etc) -- and has any one got a routine to do this? - Or would it be more appropriate to remove them altogether?--- Justin French http://indent.com.au