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

Saving content but getting  appearing

1 Answer 25 Views
Editor
This is a migrated thread and some comments may be shown as answers.
ric c
Top achievements
Rank 1
ric c asked on 21 Sep 2008, 06:05 PM

Hi,

I'm using the following code to save content from my editor:

string content = passedContent
StreamWriter SW;
SW=File.CreateText("c:\\Test.html");
SW.WriteLine(content);
SW.Close();

/* this is the html that is passed from the editor
<table>
    <tbody>
        <tr>
            <td>test </td>
            <td> </td>
        </tr>
    </tbody>
</table>
*/
this works fine. However when I view the html file I see  appearing within the content (within the empty table cell etc). When I open the page in notepad and re save using Encoding UTF-8 and the  disappear.
So I have tried:
SW.WriteLine(fileText, Encoding.UTF8);
but I'm still getting the  appearing!
Any ideas as to what’s happening?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 Sep 2008, 09:24 AM
Hi Ric,

Having Â's around means that you probably do not save the file with the correct encoding - or, alternatively, you save it in one encoding, but display on a page with a different encoding. Our suggestion is to check and make sure all is saved with the same encoding.

Please, try the suggestions provided in the following help article:
Appearance of odd characters after saving RadEditor's content in Database.

You can save the ascx file with Unicode encoding using Visual Studio -> File -> Save <PageName> As -> Click on the bottom arrow dropdown button next to the Save button -> choose Save with Encoding -> choose Unicode (UTF-8 with signature). See the screenshot for more information.

You have to also set <globalization fileEncoding="UTF-8"/> in your web.config file.

In case you are not able to get things working, please open a support ticket and send us a working project that demonstrates the issue and we will look into it.


Best wishes,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
ric c
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or