We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Pound sign in Rich Text Editors

Hi, so from a rich text editor I made a function where it would export the contents of the RichTextEditor to a html file. But it seems like it wasnt able to properly save it as when I loaded it back, it would be '?'. Is there any workaround to be able to save it as character entities to be able to load it back up?


1 Reply

VJ Vinitha Jeyakumar Syncfusion Team February 24, 2023 12:14 PM UTC

Hi Nicholas,

This issue occurred because of the non-zero width space added to the Rich Text Editor for the cursor pointer and this can be resolved by replacing the non-zero width space with the empty value in the Rich Text Editor content before saving the value in the database. We have prepared a sample for your reference,

Code Snippet:
<SfRichTextEditor ID="SubjectiveID" MaxLength="500" ShowCharCount="true" @bind-Value="@SampleText"> 
<SfButton Type="submit" CssClass="e-primary" @onclick="@SaveText">Save</SfButton> 
@code { 
    public string SampleText { get; set; } 
    public void SaveText() 
        Regex rgx = new Regex(@"[\uFEFF\u200B]"); 
        this.SampleText = rgx.Replace(this.SampleText, ""); 

Please check the above code snippet and the sample and let us know if it resolves your issue.


Live Chat Icon For mobile
Up arrow icon