javascriptkendo-uidecodeencodekendo-editor

Decode HTML Entity in Kendo Editor without losing styles and colors


I have a problem: During postback if special characters were entered, I see them in the editor with the encoding.

How do I decode them?

Eg à becomes à;

I need to decode à to à

Example in Dojo

If I try to do someting like that:

    var lDecodedValue = $("<div/>").html($("#editor").val()).text();
    editor.value(lDecodedValue);

It works, however I lose any styles or colors inserted in the text, I would like to preserve them.


Solution

  • You need to change the encoded for the kendo editor to true:

    $("#editor").kendoEditor({
      encoded: true
    });