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 -- LeiFan - 02 Mar 2009
119,122c119
< #        $text = Encode::decode_utf8($text);
<       if (utf8::valid($text)) {
<               utf8::decode($text);
<       }
---
>         $text = Encode::decode_utf8($text);


Related:

-- PaulHarvey - 24 Jan 2010
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads