This is a migrated thread and some comments may be shown as answers.

[Solved] Unicode Characters: Telerik undefined

3 Answers 94 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Nicholas Bott
Top achievements
Rank 1
Nicholas Bott asked on 27 Apr 2009, 07:11 PM
I am trying to implement the "hack" solution to preserve HTML symbols instead of converting them to Unicode.  My problem is that "Telerik" is undefined in the javascript.  I don't have any references to Telerik.Web.UI as I am just using RadEditor, nothing else by Telerik.  Can you give me the numeric value for the enum: Telerik.Web.UI.Editor.Filter

If this is not an enum, can you give me the javascript definition for that variable?

I'm fairly certain that is the problem spot in the script.

Thanks much.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 28 Apr 2009, 11:47 AM
Hi Nicholas,

I believe that you are trying to use the solution provided in this KB Article: Converting Unicode symbols to numeric HTML entities using a content filter. Am I correct?

However the code provided in the article applies only to RadEditor for ASP.NET AJAX (Telerik.Web.UI.dll) and if you are using the classic version (RadEditor.Net2.dll) then it will not work. That is why, could you please send us the exact version of RadEditor that you use in your project so we can provide an appropriate solution for your scenario.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Nicholas Bott
Top achievements
Rank 1
answered on 28 Apr 2009, 04:52 PM
Correct on the KB article.

The version of the library I am using is 7.0.2.0.  The library name is "RadEditor.dll".

Thank you.
0
Rumen
Telerik team
answered on 01 May 2009, 12:05 PM
Hi Nicholas,

Here is the required solution for RadEditor Classic, based on the Content Filters help article:

<script type="text/javascript"
function RadEditorCustomFilter() 
  this.GetHtmlContent = function (content) 
  { 
     var newContent = content; 
     //Make changes to the content and return it     
            //Convert all symbols to their numeric HTML entities     
            newContent = content.replace(/А/gi, "&#1040;");      
            newContent = newContent.replace(/Б/gi, "&#1041;");      
            newContent = newContent.replace(/В/gi, "&#1042;");      
            newContent = newContent.replace(/Г/gi, "&#1043;");      
            newContent = newContent.replace(/Д/gi, "&#1044;");      
            //Go ahead and add all letters. Note: this will likely cause a performance problem      
            //newContentnewContent = newContent.toUpperCase();     
         return newContent;     
  }; 
 
/* Use the editor onload function to register the filter with the FiltersManager */ 
function onClientLoad (editor) 
  var customFilter = new RadEditorCustomFilter(); 
  editor.FiltersManager.Add(customFilter); 
 
</script> 
<rade:RadEditor 
   ID="editor1" 
   Runat="server" 
   OnClientLoad = "onClientLoad" > 
   content as Unicode: А Б В Г Д     
    <br />    
    Original content as numeric: &#1040; &#1041; &#1042; &#1043; &#1044;   
</rade:RadEditor> 



Greetings,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Nicholas Bott
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Nicholas Bott
Top achievements
Rank 1
Share this question
or