PDA

View Full Version : Removing unicode type stuff


Rob_Che
05-13-2012, 11:17 AM
Getting text that has been entered using a WYSIWYG and I'm getting odd unicode characters.
So - where I expect:

<p>Some text</p>
<p>Some more text after the break</p>


I'm getting:

<p>Some text</p>
<p>�</p>
<p>Some more text after the break</p>
<p>�</p>


How can I clean this up?

gentleone
05-13-2012, 04:33 PM
Hi Rob,
I asume it gives a an empty paragraph in the code as soon as they do a hard return after a paragraph in the WYSIWYG editor. Am I right? Actually the same as what DW design view does only it wil give this in the code:
<p>&nbsp;</p>
What's the charset of the document and did you also set this character encoding in the HTTP header?

Rob_Che
05-13-2012, 05:26 PM
Thanks GentleOne - it's actually tinyMCE within Wordpress but it's spewing these things out on one particular text area.

Very annoying though.

Is there a way of encoding them on the way OUT of the db?

gentleone
05-13-2012, 05:38 PM
Sorry, Rob... I don't know anything about WP and its backend. It's weird tho' that it only happens at one particular textarea. DWCourse might have a clue, but I haven't seen him for a while.

davidj
05-16-2012, 09:28 PM
you need to add this to your init script

tinyMCE.init({
entity_encoding : "raw",
...
});