alarik149 Posted May 15, 2007 Share Posted May 15, 2007 Hi people. I have a very interesting issue here, or it is interesting from my point of view. I have a database with a lot of names and some of them are german or french or any other language that has special characters. let's say we want to add "Jádson" to the database. when added,in the database I find "Jádson" instead of "Jádson". It is quite OK because when I try to echo each field, in any browser, I see "Jádson" not "Jádson",and this is what I want. The problem is when I try to search something in the database. If I make a link,something like www.site.com/$name and each time $name changes,when I get to "Jádson" it dosen't find any entry in the database with that name, because in the database it is actually "Jádson", so I can't use any information for this guy. I guess everyone sees my problem. I need 2 things. 1 - First of all I need a way, an algorithm to parse back from "Jádson" to "Jádson", that workes for any kind of characters,not just this. For example, if I input in a field "Jádson" I should get back this string -> "Jádson". 2 - Secondly, I need a way, an algorithm that can change any name like "Jádson" or "Jérémy" or "Tomić" to "Jadson" and "Jeremy" or "Tomic" . Cheers and thank you for banging your head along with me. Link to comment https://forums.phpfreaks.com/topic/51578-parsing-backwards/ Share on other sites More sharing options...
ToonMariner Posted May 15, 2007 Share Posted May 15, 2007 have a look at htmlentities(); Link to comment https://forums.phpfreaks.com/topic/51578-parsing-backwards/#findComment-254026 Share on other sites More sharing options...
btherl Posted May 16, 2007 Share Posted May 16, 2007 For your second question, that can only be done by a lookup table, not an algorithm. Unfortunately I can't help you with finding the table. Basically you need a table showing each accented character along with its plain equivalent, for every language that you plan to handle, and for whichever encoding you are using (utf8?). Then you just run the string through that table, making the appropriate conversions. Link to comment https://forums.phpfreaks.com/topic/51578-parsing-backwards/#findComment-254090 Share on other sites More sharing options...
alarik149 Posted May 16, 2007 Author Share Posted May 16, 2007 hmm,i`ll check it out.but I don`t think this helps me Link to comment https://forums.phpfreaks.com/topic/51578-parsing-backwards/#findComment-254781 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.