HtmlEditor :  Phorum 5 The fastest message board... ever.

This is the discussion forum for the HtmlEditor. See also the HtmlEditor home page, where you can download the control, and the Documentation Wiki, a collaborative project for documenting the control.

Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
unicode,utf8
Posted by: gaiaway (58.143.70.---)
Date: Sunday, 09-Jul-2006, 09:38:58

Hello!

i've been trying to use your control(in NET 2.0). However when I load a document(with a utf8 encoding) by LoadDocument(string s), i see all korean characters crashed.
meta tag is like below,
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">

its view under web browsers are fine.
of course, DocumentEncoding property of htmlEditor is set to UTF8
(i tried other encoding options also)

the result is almost same after all this trial.

I have no idea how to fix that.
Any help will be appreciated .

Best regards

Re: unicode,utf8
Posted by: Tim (---.gotadsl.co.uk)
Date: Monday, 10-Jul-2006, 07:15:46

I agree, this is a rather mysterious area.

Is this the latest version from the repository?

Have you checked that the BOM is being applied? and the new DefaultPreamble property?

Tim

Re: unicode,utf8
Posted by: gaiaway (58.143.70.---)
Date: Tuesday, 18-Jul-2006, 02:18:41

hello Tim.
Sorry for my late response.
i've found an article about the similar situation like me.
it suggested to insert some codes in util.cs.
(trying to insert BOM when the file is missing it)
i followed his words. but still got some weird charaters.
so i tried to insert the code(inserting BOM at the file header) before
i call htmleditor.LoadDocument() like this

byte[] preamble = UnicodeEncoding.Unicode.GetPreamble();
String byteOrderMark = UnicodeEncoding.Unicode.GetString(preamble, 0, preamble.Length);
HTMLFile = byteOrderMark + HTMLFile;

HTMLEditorcontrol.LoadDocument(HTMLFile);

after that, it works fine so far.
i'm afraid i don't have much time to search why sad smiley
just i hope some beginners like me can use this poor solution as a temporary one.

Regards
Park

Re: unicode,utf8
Posted by: gaiaway (58.143.70.---)
Date: Tuesday, 18-Jul-2006, 02:29:04

hmm...
i've just retried the codes to insert BOM in util.cs like this,


if (
(documentVal.StartsWith('\xFEFF'.ToString()))
|| (documentVal.StartsWith('\xEFBB'.ToString()))
|| (documentVal.StartsWith('\xFFFE'.ToString()))
|| (documentVal.StartsWith('\x0000'.ToString() + '\xFEFF'.ToString()))
)
{
byte[] preamble = UnicodeEncoding.Unicode.GetPreamble();
String byteOrderMark = UnicodeEncoding.Unicode.GetString(preamble, 0, preamble.Length);
documentVal = byteOrderMark + documentVal;
}
else
{
byte[] preamble = UnicodeEncoding.Unicode.GetPreamble();
String byteOrderMark = UnicodeEncoding.Unicode.GetString(preamble, 0, preamble.Length);
documentVal = byteOrderMark + documentVal;
}


it works fine now. i don't know why it didn't work before.
maybe i made some mistakes when trying that..
(i can't find the delete button for the above post)
sorry for my messy writing.
bye.

Park.

Re: unicode,utf8
Posted by: Tim (---.gotadsl.co.uk)
Date: Tuesday, 18-Jul-2006, 07:13:12

This is old code, you should try the latest in the repository.

Tim



Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically.
uvhMD
This is a moderated forum. Your message will remain hidden until it has been approved by a moderator or administrator
This forum powered by Phorum.