Solved

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

Posted on 2015-01-06
3
332 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 32

Accepted Solution

by:
Big Monty earned 300 total points
Comment Utility
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
Comment Utility
(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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
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.
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…

771 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

7 Experts available now in Live!

Get 1:1 Help Now