[opencms-dev] Accented & Special Characters in WYSIWYG Editor

kevin fong kfong at spto.org
Thu Jun 24 06:24:01 CEST 2004


Hi all,

Whilst using the WYSIWYG MSHTML editor to edit pages, I realised that accented characters like "ë" become malformed after the page is saved.
By changing the following  file /system/workplace/skins/modern/editors/msdhtml/scripts/edithtml.js :
================================================================================
function saveContent() {
	var _form = document.EDITOR;
	var _editor = _form.EDIT_HTML;
	var content_to_save = "";
	if (_editor.DOM.documentElement) {		

// FROM:  _form.content.value = encodeURIComponent(_editor.filterSourceCode(_editor.DocumentHTML));

		_form.content.value = _editor.filterSourceCode(_editor.DocumentHTML); 	//CHANGED TO

	} else {
		// IE4
		_form.content.value = encodeURIComponent(_editor.DocumentHTML);
	}
}

================================================================================

By excluding encodeURIComponent, it fixes "malformation" problem with accented characters but creates other encoding exceptions when content that needs 
to be converted by encodeURIComponent does not get encoded properly(because the method is now excluded).  Sort of a catch 22 situation here and would most appreciate any advice on this matter especially from the experts out there who content manage websites that uses languages that have accented characters.

The workaround solution is to use the source code editor to use the html encodings "&eactute;" but my end users are not familiar with html and this does not serve as an acceptable solution for them.



More information about the opencms-dev mailing list