Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have integrated tinymce editor of wordpress to my custom plugin. I save the data entered in to Database via ajax like this:

encodeURIComponent('<?php echo mysql_real_escape_string(stripslashes($_POST['title'])); ?>');

But in frontend as well as in DataBase Custom Characters like diamond etc are stored and displayed as question mark.

share|improve this question
add comment

1 Answer

You have to encode the string you store in UTF-8 or whatever the site is using as encoding.

If you don’t store valid UTF-8 you get the famous diamonds. In websites, these are not girls best friends, they just break your output. :)

See this answer for some code to encode text as UTF-8 in PHP.

share|improve this answer
    
Diamonds may be forever, but so are encoding conflicts ;) –  Eric Holmes Apr 4 at 12:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.