Item12348: Characterset conversion does no longer work in MetaCommentPlugin

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release:
Applies To: Extension
Component: MetaCommentPlugin
Branches: master
Reported By: ChristianDHeureuse
Waiting For:
Last Change By: MichaelDaum
After upgrading to the current MetaCommentPlugin version 2.20, the encoding of non-ASCII characters was wrong in comments. The browser sends them as UTF-8. My Foswiki pages are stored in ISO-8859-1. (Configuration parameter "{Site}{CharSet}" is "iso-8859-1").

Before revision 11673, Core.pm did convert text input data in jsonRpcSaveComment and jsonRpcUpdateComment:

   $cmtText = fromUtf8($cmtText);
   $title = fromUtf8($title);

I could fix the problem by moving these statements and the fromUtf8 subroutine into the newest Core.pm.

-- ChristianDHeureuse - 15 Jan 2013

Actually, recoding should be taken care of in JsonRpcContrib.

-- MichaelDaum - 18 Mar 2014

There is an error extracting sub-strings however. As strings are bytes and not unicode internally, those have to be encoded properly before running subst() on them. Otherwise substring-ing a string of bytes might cut unicode chars in half occasionally.

-- MichaelDaum - 16 Dec 2014
 
Topic revision: r3 - 16 Dec 2014, MichaelDaum
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