Opened 18 years ago
Last modified 18 years ago
#724 closed Bug
Apostrophes broken in FCKeditor.Java — at Initial Version
Reported by: | Martin Kou | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Server : Java | Version: | |
Keywords: | SF | Cc: | ickata@…, Frederico Caldeira Knabben |
Description
In FCKeditor.Java version 2.3, in the file FCKeditor.java, the HTMLEncode method escapes apostrophes incorrectly. It uses ’, which is actually the Windows Cp1252 encoding of the right single quotation mark character (U+2019). Apostrophe is actually U+0027, or '.
The symptom is that when a text containing apostrophes is edited, the apostrophes are all converted to right single quotation marks at the time of rendering the editor.
My recommendation is to simply not escape apostrophes at all, since the output of this method is never placed inside apostrophes (it's used both as a double-quoted HTML attribute value and as the text content within an HTML element). Simply remove the following line from the HTMLEncode method:
txt=txt.replaceAll("'","’");