Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 503
  • Last Modified:

Random Question Marks in CKEditor... Where are they coming from???

We have a Coldfusion application that utilizes CKEditor.  We've found that when some users enter data, save their form, then come back into said form later, that the editor content in the saved draft form has random question marks.  I've created a user defined function that attempts to strip out any random question marks from the saved data before it is populated into the CKEditor instance when the draft form is reloaded.  My thought was that it might be an encoding issue, however, I've verified that nothing in the process is out of sync with UTF-8.  So, the question is, where do/does, the question marks/mark come from?

Below is a portion of the User Defined Function that strips out the question marks, which appear in pairs, or alone, typically proceeding a line break:
	// strip out random question marks
	text = replaceNoCase(text, '<br>??', '<br>', 'all');
	text = replaceNoCase(text, '<br />??', '<br />', 'all');
	text = replaceNoCase(text, '<br>?', '<br>', 'all');
	text = replaceNoCase(text, '<br />?', '<br />', 'all');
	text = replaceNoCase(text, '&nbsp;?', ' ', 'all');
	text = replaceNoCase(text, '%?', '%', 'all');
	text = replaceNoCase(text, '?%%', '%%', 'all');
	text = replaceNoCase(text, '??', '', 'all');

Open in new window


I'd feel much more comfortable with a legitimate fix than using the bandage that is currently in place.  Any insight is greatly appreciated.  Thanks in advance!

~Brian
0
brianmfalls
Asked:
brianmfalls
2 Solutions
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
this def sounds like an encoding issue, are you positive you have your encoding identified properly on the page? it would look something like:

<meta http-equiv=Content-Type content="text/html; charset=windows-1252">

if you're running Apache, edit your Apache configuration file  and comment-out the following line:

AddDefaultCharset UTF-8

Then restart Apache:

service httpd restart
0
 
_agx_Commented:
(No points...)

Almost certainly an encoding issue.  

I've verified that nothing in the process is out of sync with UTF-8

Sounds like there are several steps involved. Can you post a small example of the submission + edit scripts that demonstrates the issue?

then come back into said form later, that the editor content in the saved draft form has random question marks

So it only occurs when displaying saved data? I assume you're storing the draft in a db table.  What is the data type of the column, and which dbms?
0
 
brianmfallsAuthor Commented:
So... it turns out that there were files on the server that were not in svn, and there by not on my computer.  I got everything sync'd up and low and behold, there were quite a few meta tags setting the charset to iso-8859-1, which created an encoding conflict.  EVERYTHING is now set to UTF-8.  EVERYTHING.  Oddly enough, we haven't seen the random question marks sense.  Thanks for the input guys.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now