This question about : Task filed

Type in Chinese

Hi, sorry I don't know where to share this patch. I'm new here. So I put this message here.

It's OK to type Chinese characters in the WYSIWYG editor, but it shows an error when clicking the "save" button.

Here is a solution:

Edit foswiki/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML.pm:
113c113,116
<         $text = Encode::decode_utf8($text);
---
> #       $text = Encode::decode_utf8($text);
>         if (utf8::valid($text)) {
>             utf8::decode($text);
>         }

Then you can save Chinese characters in WYSIWYG editor without errors.

-- ChiaHaoLo - 23 Jan 2009

-- ChYang - 24 Jan 2009

IIRC I tried this when I was working on utf8 before, and while it fixes Chinese, it breaks other non-utf8 character sets such as Cyrillic. Fixes for character sets unfortunately have to work for all character sets, at least until we have switched to utf8 everywhere.

-- CrawfordCurrie - 24 Jan 2009
  • Chinese characters cannot be saved correctly even following the above instruction. the error Log reads the following:][zhCN_error.PNG
-- LeiFan - 02 Mar 2009
  • LeiFan, If you are using Foswiki 1.0.6, please modify your lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML.pm
    as the following patch. It works for me.
119,122c119
< #        $text = Encode::decode_utf8($text);
<       if (utf8::valid($text)) {
<               utf8::decode($text);
<       }
---
>         $text = Encode::decode_utf8($text);


Related:

-- PaulHarvey - 24 Jan 2010

QuestionForm edit

Subject
Extension WysiwygPlugin
Version
Status Task filed
I Attachment Action Size Date Who Comment
zhCN_error.PNGPNG zhCN_error.PNG manage 2 K 02 Mar 2009 - 03:42 LeiFan chinese char errors
Topic revision: r10 - 24 Jan 2010, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy