With the Prometheus version of RadEditor, if there are two consecutive spaces in a sentence, they are preceded with Â. For example, if I type
test. test.
and then place this into a database (using the Content property of the editor), when the string is written onto a web page it looks like this:
test. test.
I tried using the Q3 version of RadEditor and it does not have the same issue, it just replaces one of the spaces with which makes perfect sense. Can anyone shed some light on this problem.
11 Answers, 1 is accepted
For some reason, the non-breaking space character (code 0xA0) is being converted to something else when you save the content. I think that this is a character encoding problem with the database column where you store the editor content. Try using a unicode type (e.g. nvarchar instead of varchar or ntext instead of text).
Sincerely yours,
Lini
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Thanks for your quick response. I actually figured out the problem, I was writing this string on a classic ASP page and I needed to set the Response.Charset option before I wrote the string:
Response.Charset="UTF-8"
Response.Write(string)
I tried this with the database column set to varchar and nvarchar and it didn't make any difference. The funny thing is that when I used the Q3 version of RadEditor I didn't need to set the Response.Charset option. Either way, I think I solved the problem. Thanks for the help.

The db storage is correct--it goes in as 160 and returns as 160.
Thoughts? Or is this just something that e-mail clients will have to manually adjust to?
Thanks,
D.

How do i set the encoding to utf-8?
Please help me.
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.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

What happens for me is I have a button that will save the content of the radEditor. During the save, I encode the content using UTF-8. After I encode the content, if I check the individual bytes, the two white spaces are inserted at characters 194, 160, and 32. Character 194 is the A with the accent, character 160 and 32 are spaces. This problem is before it ever is inserted into a database or saved to a file so that is what is coming from the editor. It should only be inserting two spaces and not adding the other character. Is there any fix for this problem?
If you have set <globalization fileEncoding="UTF-8"/> in your web.config file and you still experience this problem, please open a support ticket and send a sample running project that demonstrates it. Please, provide steps to reproduce the problem.
I will examine it and once I reproduce the problem will provide guidance how to fix it.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

In our application we allow the user to export data typed into the RadEditor to Microsoft Word. Whenever we use Firefox (version 3) it works fine, but when we use Internet Explorer (version 7) we get the "A" character with the mark above it anywhere that there are two spaces.
Here's how I reproduce the issue...
* Create a new record and type the information into the RadEditor. Then export to Word and everything looks fine. Let's assume that we typed "this is a test." into the RadEditor.
* Edit the record. As soon as you click into the RadEditor to edit the text there is mysteriously an extra space at the end. So it looks like "this is a test. " instead of "this is a test.". If I leave that space there (I have no clue where it came from) update the record the report still renders fine in Word.
* Edit the record again. This time I manually add an additional space at the end after that "mysterious space" and click the update button. Now when I render the report to Word that "A" with the accent above it appears.
This only seems to be happening with IE. When I use Firefox that "mysterious space" never appears. Is this a bug with IE or is our application not configured properly?
Having Â's around means that you probably do not aspx file does not have the correct encoding, you do not save the content 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.
If you store the content in a database, then you should change the data type of the database column to nchar or ntext. The nchar type returns the Unicode character with the given integer code, as defined by the Unicode standard. You can find additional information about these SQL column types in the MSDN help center by following the next link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_na-nop_25gy.asp.
Please, try the suggestions provided in the following help article too:
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).
You have to also set <globalization fileEncoding="UTF-8"/> in your web.config file.
Here are some links that discuss [file] encoding.
http://support.microsoft.com/kb/893663
http://msdn.microsoft.com/en-us/library/39d1w2xf.aspx
http://weblogs.asp.net/ssadasivuni/archive/2005/01/19/355935.aspx
The extra space at the end is due to the \r\n" being added to content when submitted. The \r\n are added for readability. Due to them when the editor's content is displayed in Html mode or in the Database it will be readable.
If you do not want these line-feed and line breaks in the produced content you can strip them with
RadEditor1.Content.Replace("\r", "").Replace("\n", "");
You can find more information in the following KB article: "\r\n" being added to content when submitted.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Here's the old code...
Response.Clear(); |
Response.ContentEncoding = Encoding.UTF8; |
Response.ContentType = "application/msword"; |
Response.AddHeader("Content-Disposition", "attachment; filename=test.doc"); |
Response.Write("<html><body>"); |
Response.Write(level.LevelDescription); |
Response.Write("</body></html>"); |
Response.End(); |
And here's the new code...
Response.Clear(); |
Response.ContentEncoding = Encoding.UTF8; |
Response.ContentType = "application/msword"; |
Response.AddHeader("Content-Disposition", "attachment; filename=test.doc"); |
Response.Write("<html><head><meta http-equiv='content-type' content='text/html; charset=UTF-8' /></head><body>"); |
Response.Write(level.LevelDescription); |
Response.Write("</body></html>"); |
Response.End(); |
After putting the meta tag in that indicates utf-8 for the Word document the weird character does not display.

protected void Button1_Click1(object sender, EventArgs e)
{
//Open file for writing and write content
using (StreamWriter externalFile = new StreamWriter(this.MapPath(path), false))
{
externalFile.Write(RadEditor1.Content);
}
}
For me, this needed to be:
protected void Button1_Click1(object sender, EventArgs e)
{
//Open file for writing and write content
using (StreamWriter externalFile = new StreamWriter(this.MapPath(path), false, Encoding.UTF8))
{
externalFile.Write(RadEditor1.Content);
}
}