logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 05-13-2012, 11:17 AM   #1
Rob_Che
Rob_Che's Avatar
 
Join Date: Feb 2008
Posts: 1,552
Default Removing unicode type stuff

Getting text that has been entered using a WYSIWYG and I'm getting odd unicode characters.
So - where I expect:

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

I'm getting:

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

How can I clean this up?
Rob_Che is offline   Reply With Quote
Old 05-13-2012, 04:33 PM   #2
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

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:
HTML Code:
<p>&nbsp;</p>
What's the charset of the document and did you also set this character encoding in the HTTP header?
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 05-13-2012, 05:26 PM   #3
Rob_Che
Rob_Che's Avatar
 
Join Date: Feb 2008
Posts: 1,552
Default

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?
Rob_Che is offline   Reply With Quote
Old 05-13-2012, 05:38 PM   #4
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

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.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 05-16-2012, 09:28 PM   #5
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

you need to add this to your init script

Code:
tinyMCE.init({
     entity_encoding : "raw",
...
});
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:06 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com