Solved

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

Posted on 2015-01-06
3
357 Views
Last Modified: 2015-01-14
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
Comment
Question by:brianmfalls
3 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 300 total points
ID: 40533468
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
 
LVL 52

Assisted Solution

by:_agx_
_agx_ earned 200 total points
ID: 40535787
(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
 
LVL 1

Author Closing Comment

by:brianmfalls
ID: 40548804
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now