I send TinyMCE input to POST (a php file), then save it in MySQL Database.
The input has UTF-8 (Turkish characters). So when I type Türkçe
inside the TinyMCE input and send it to post, PHP backend receives this string :
<p>Türkçe</p>
How can I convert it back to Türkçe
so I can save it correctly in MySQL ?
MySQL is set to utf8_unicode_ci
collation, so it can save UTF-8 characters correctly.
I need to convert them in PHP, I guess.
Or a way for TinyMCE to send them correctly?
Thanks for any help !
I think that this issue is about TinyMCE itself, so I guess the solution will be converting the TinyMCE output (either in TinyMCE javascript, or the receiving PHP script).
i.e. : I don't think changing my PHP configuration is the solution.
I guess these characters like ü
are the HTML equivalents of Turkish characters, so htmlspecialchars_decode()
should work, but it does not accept Turkish characters. Maybe a way for htmlspecialchars_decode
to decode UTF-8 Characters ?
Use this code
<script type="text/javascript">
tinymce.init({
entity_encoding : "raw"
});
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With