Forum Moderators: coopster
I have been coding in PHP/MySQL for a few years, but have never had to deal with foreign characters before, and have come accross a problem.
I am setting up a table of event types, which has an ID, an english event type, and the corresponding translation in turkish.
I am manually entering these characters into the database, using phpMyAdmin, and am coming up with this problem:
I am trying to get this forum to display the actual character, but seems like it has encoding problems as well, so will only print ASCII. Here it is though!
When entering " İş temasları ", the database actually stores " Ýþ temaslarý " instead...
So some characters are being stored fine, but other characters aren't. If I use the ASCII codes istead of the actual character, the search system I have will not find the results, if the user enters the charecter itself instead of the ASCII code.
Another issue I have, is with some company names that contain turkish characters.
I want to have a search facility, that allows users to search for companies. The problem is that some users will not have turkish characters, and so will enter the corresponding english character instead, but I would still like the search forum to find the results.
Example: Öbur is a company, but I would like it to be found when searching for Obur as well.
Any thoughts, hints or tutorials would be much appreciated.Please bare in mind that I know very little about encoding, but from what I understand, the pages should be unicoded, thats all I know!
Many thanks,
Duncan
You need a table similarities (id, similar, correct): 1, 'Obur', 'Öbur'; 2, english_character, turkish_character;...
in which you store the words without turkish letters and their correct words.
Then while searching, you join exact search pattern with the correct search pattern. (I come from Poland and there are words that transfered into english characters also give another polish word).
Hope this helps you at least a bit.
Best regards
Michal Cibor
[edit]By the way, when you say that the database stores the letter instead of the entity, I believe this is what you see in PhpMyAdmin, as a result of html_entity_decode(), but that the real content of the record is the entity. Check by exporting the data in PhpMyAdmin.[/edit]
Hope this helps.
Notawiz
[webmasterworld.com...]
It's not addressing your problem specifically, but it might help with understanding some encoding issues.