diff --git a/editor/ui/composer/content/editor.js b/editor/ui/composer/content/editor.js index 590332ab8d9..0ae4d7ab9da 100644 --- a/editor/ui/composer/content/editor.js +++ b/editor/ui/composer/content/editor.js @@ -2476,14 +2476,10 @@ function EditorSetDefaultPrefsAndDoctype() catch (ex) {} if ( prefCharsetString && prefCharsetString != 0) { - element = domdoc.createElement("meta"); - if ( element ) - { - element.setAttribute("http-equiv", "content-type"); - element.setAttribute("content", "text/html; charset=" + prefCharsetString); - headelement.insertBefore( element, headelement.firstChild ); - editor.documentCharacterSet = prefCharsetString; - } + editor.enableUndo(false); + editor.documentCharacterSet = prefCharsetString; + editor.resetModificationCount(); + editor.enableUndo(true); } var node = 0;