Forum Moderators: coopster
I've set up my website for url-rewriting using .htaccess and changed the links to be sort of like this:
www.example.com/catalog/product-name
Product names are of course stored in database, with international characters which display properly (utf-8) for now.
(In some fields I had to use š and ž directly and sometimes stuff like š -- why doesn't š and ž work in all letters?)
But anyway, I got it display fine but now I've got another problem.
Product-name is being passed to code which searches for it in database and displays it's content. It's working excellent, unless it has some international characters.
In which case I got this:
www.example.com/catalog/Za%C5%A1ti%C4%87ene-%C5%BCivotinjske-vrste/
Note the appearing %C5%A1 %C4%87 and %C5%BC
It doesn't even get to the php code, it returns error imidiatelly.
The actual database entry is:
Zaštićene żivotinjske vrste
How can I make a valid reference to this database entry?
And, if possible, a user-friendly one?
Thanks in advance!
[edited by: dreamcatcher at 6:31 pm (utc) on Aug. 26, 2007]
[edit reason] Use example.com, thanks. [/edit]
I could implement sort of a "slug" -- separate field in table which would be used as reference in URL (and avoid using strange chars), but that's would be complex since there's already a number of entries in DB.
How about html_entity_decode [php.net] and urldecode [php.net], do they help at all?