Technical support This forum is closed.
Version 1.x > Technical support > FCKEditor and unicode characters View modes: 
User avatar
Member
Member
drew - 5/18/2005 1:44:34 AM
   
FCKEditor and unicode characters
A web site page we are developing needs to have some content displayed using multiple languages (chinese and russian). We are using unicode characters to display the content correctly in HTML. Unfortunately, when we save the article the unicode characters are getting replaced with ?. Is there a setting that needs to be turned on to allow unicode characters to be saved correctly?

Thanks

User avatar
Member
Member
wtijsma - 5/18/2005 4:43:07 PM
   
Re: FCKEditor and unicode characters
Just tried it, I'm having the same problem. I'm trying to figure it out now what to do.

some solutions could include (but haven't tried it yet):
- You may have to convert GB2312 (or GB18030) to UTF8/Unicode.

- kentico has to add UTF8 meta tags to their HTML mode, and/or switch to a W3C compliant format for their CMSDesk aspx files to prevent a browser from going into 'quirks' mode (?!)

- change the output format of the pages to UTF8 in the web.config
<system.web>
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>

p.s. I created a little tool that can convert 1 textfile from one encoding to another wich may be of use: http://www.netindustry.nl/resources/unicodeeditor)

User avatar
Member
Member
wtijsma - 5/18/2005 5:01:25 PM
   
Re: FCKEditor and unicode characters
Yep, solution 2 works for me:

in CMSDesk/Content/Edit.aspx add this meta tag:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

you may also need to change this:
<%@ Register TagPrefix="cc2" Namespace="Kentico.CMS.TreeEngine" Assembly="Kentico.CMS.TreeEngine" %>
<%@ Register TagPrefix="cc1" Namespace="Kentico.CMS.Form" Assembly="Kentico.CMS.Form" %>
<%@ Page Language="vb" ValidateRequest="false" AutoEventWireup="false" Codebehind="Edit.aspx.cs" Inherits="Kentico.CMS.CMSDesk.Edit" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ Register TagPrefix="cc2" Namespace="Kentico.CMS.TreeEngine" Assembly="Kentico.CMS.TreeEngine" %>
<%@ Register TagPrefix="cc1" Namespace="Kentico.CMS.Form" Assembly="Kentico.CMS.Form" %>
<%@ Page Language="vb" ValidateRequest="false" AutoEventWireup="false" Codebehind="Edit.aspx.cs" Inherits="Kentico.CMS.CMSDesk.Edit" %>

because IE expects the DOCTYPE to be on the first line for the document to be interpreted correctly.

It does require you to paste the documents in the FCKEditor in UTF8, no native chinese/russian charsets.

User avatar
Member
Member
drew - 5/18/2005 8:25:00 PM
   
Re: FCKEditor and unicode characters
wtijsma,

Thank you very much for your help. Unfortunately, I cannot seem to get your solution to work.

I added the meta tag to the Edit.aspx page and I moved the DOCTYPE to the top of the page.
I copied the following unicode characters into the source code of the page 手机 and the edit page is still saving these characters as "?".

Did I miss a step from your solution or am I incorrectly copying invalid UTF characters into the page?

Thanks again for your help,
Drew

User avatar
Member
Member
drew - 5/18/2005 8:58:59 PM
   
Re: FCKEditor and unicode characters
I am able to save the unicode characters correctly if the CMS Desk is using the FreeTextBox editor. It looks like the FCKEditor might be changing the information when it is sending the html back to the input field on the main page. Perhaps there is a setting in FCKEditor that is causing this to happen.

-Drew

User avatar
Member
Member
wtijsma - 5/19/2005 1:21:24 PM
   
Re: FCKEditor and unicode characters
Hi,

I'm not sure. I'm still using the FCKEditor from before it was in the CMSDesk, so implemented it myself using custom user controls.

I'm sure the problem isn't with the FCKEditor though, because it does work for me (with simplified chinese).

Also check if your SQL database doesn't give any trouble, but if it works with the FreeTextBox there's no problem.

Did you also add the options to the web.config?

User avatar
Member
Member
wtijsma - 5/19/2005 1:27:17 PM
   
Re: FCKEditor and unicode characters
My method of entering the characters is copying them from word (97), and using IE as client. Haven't tried firefox yet.

User avatar
Member
Member
drew - 5/19/2005 10:10:37 PM
   
Re: FCKEditor and unicode characters
I made the change to the web.config but still no luck.

User avatar
Member
Member
wtijsma - 5/20/2005 11:39:42 AM
   
Re: FCKEditor and unicode characters
Are you sure your encoding is Unicode/UTF8 and not GB2312? I think the Chinese version of word is default in GB2312 or GB18030.

Could you also try in FireFox or Mozilla? (works correctly as well with me)

User avatar
Member
Member
drew - 5/20/2005 5:42:18 PM
   
Re: FCKEditor and unicode characters
I tried it in Firefox and had the same result.

I have not had much experience with unicode/utf8 in the past but I am using this character translator http://www.pinyin.info/tools/converter/chars2uninumbers.html to help with the conversion to UTF8. The translated characters work in any web page I create and display correctly with the FCKEditor when I first past the html into the editor in source mode and then switch to design view. The problem only occurs after I click the ok button to save the data. Unlike the FreeTextBox editor, the FCKEditor appears to remove the UTF8 codes with the actual character before the save occurs. This problem only occurs when I have a large snippet of HTML code in the editor. If there is only a simple snippet with the chinese or russian UTF8 codes everything saves correctly (although the FCKEditor still replaces the UTF-8 code with the actual character).

Thanks,
Drew

User avatar
Guest
admin - 5/19/2005 2:58:41 PM
   
Re: FCKEditor and unicode characters
Hi Drew and Wiebe,

Thank you for your messages. I've just tried to copy and paste text from www.evget.com to the FCKEditor (in version 1.6 without any changes) and it works fine. Drew, could you please try to do the same?

Wiebe, thank you for your improvement! We have modified the page and the change will be included in the nearest release.

Best Regards,

User avatar
Member
Member
drew - 5/19/2005 10:09:07 PM
   
Re: FCKEditor and unicode characters
It appears to be something to do with the amount of content in the FCKeditor control which is causing the problem.

If I paste some chinese characters from evget.com into the editor control without any content in it and click save everything works correctly. However, if I paste the characters into the actual content (A simple 3 column html table which has a list of about 20 support contacts) and click OK, the system changes the chinese characters to "?". This problem does not occur with the FreeTextBox control.

Is there a setting for the FCKeditor control that will prevent it from converting unicode characters to the actual chinese character? The FreeTextBox control does not alter the unicode characters.

Thanks for your help,
Drew