Changes between Initial Version and Version 1 of Ticket #8704, comment 17
- Timestamp:
- Aug 6, 2012, 12:04:24 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #8704, comment 17
initial v1 16 16 And, in my ajax function I have: 17 17 {{{ 18 if(CKEDITOR.instances.editor5 !== undefined){ 19 var editor5 = escape(CKEDITOR.instances.editor5.getData()); 20 }else{21 var editor5 = '';18 var editor5 = ''; 19 if(CKEDITOR.instances.editor5 !== undefined) 20 { 21 var editor5 = encodeURIComponent(CKEDITOR.instances.editor5.getData()); 22 22 } 23 23 }}} 24 24 The difference now is the lines I added to config.js. I have had no other reports from users about special characters and Unicode characters showing up in the text from the editor. 25 26 '''EDIT:''' I changed the code in my ajax function above to use the correct JavaScript function to encode the text from the editor to properly prepare the text to be included in the query string which is sent to the PHP script. Thank you j.swiderski for pointing out the mistake so I could make corrections! For anyone who finds themselves having similar issues, do not use the {{{escape()}}} function, instead use the {{{encodeURIComponent()}}} function. Here is the link j.swiderski posted: [http://stackoverflow.com/questions/75980/best-practice-escape-or-encodeuri-encodeuricomponent].