+ 1

Failing to save diacritic text into database.

Hello. I want to ask you, if you can help me with my problem. I have a database with one table with two columns (primary int "id" and varchar "data") and I save text submitted on my webpage into it. It works nicely, but I can't save certain words into it. This is a big problem, because I need this for my school class and they want it to work in my native language (Czech). My language has these special characters: ĂĄ, Ă©, ě, Ă­, Ăł, Ăș, ĆŻ, Ăœ, č, ď, ƈ, ƙ, ĆĄ, Ć„, ĆŸ. When I submit e.g. word "Ćœena" (woman in English), it saves just empty string. If I submit PoĆĄta (post), it saves "Po". If I echo the query I want to execute, it outputs the word correctly. If I execute the same query directly in php admin interface, it saves the word correctly as well. Error is somewhere in comunications. Strange thing is, that it automaticaly converts some of those letters into some codes and then it outputs it back into the page correctly. Is there any method that converts all the other letters into these codes? Thanks for any reply.

22nd Jul 2018, 3:05 PM
Jan Ơtěch
Jan Ơtěch - avatar
5 Answers
+ 3
Jan Ơtěch I found this discussion link on SO, hope it could come of use somehow, look at the top answer, it comes with details and links to even more resources. https://stackoverflow.com/questions/279170/utf-8-all-the-way-through P.S. Never mind if you already read it, or if it didn't help. Hth, cmiiw
22nd Jul 2018, 5:39 PM
Ipang
+ 2
Jan Ơtěch Alright, hope it works out, I also thank you, I learned something again from searching for a solution to this, best of luck on that project : )
22nd Jul 2018, 6:02 PM
Ipang
+ 1
Fopen codes that "ƙ" and "č" gets converted to looks like this: &#269. But I need to know if there is any method that will convert special characters in a string into these symbols automaticaly. Ipang Thanks a lot. I seems to work so far.
22nd Jul 2018, 5:52 PM
Jan Ơtěch
Jan Ơtěch - avatar
0
use special characters á
22nd Jul 2018, 5:49 PM
Fopen
Fopen - avatar
0
give me the answer
23rd Jul 2018, 6:43 AM
divya v
divya v - avatar