Item13372: Encoding problems (utf8) on Macro arguments

pencil
Priority: Urgent
Current State: Closed
Released In: 1.2.0
Target Release: minor
Applies To: Engine
Component:
Branches: master
Reported By: JozefMojzis
Waiting For:
Last Change By: CrawfordCurrie

How to reproduce

Х Create UTF8 installation
  • Create Any Topic
  • Enter some macros, where the arguments are utf8, for example:

ссс

ссс

some text

ссс
aaa bbb ccc

  • Save
  • Edit Again
  • Save
  • The utf8 text -> wrong encoding

Also, when in WYSIWYG switch to NatEdit - in the NatEdit the utf8 texts are screwed.

  • screenshot_57.png:
    screenshot 57.png

  • screenshot_59.png:
    screenshot 59.png

-- JozefMojzis - 14 Apr 2015

Is this really on 1.2.0 or on 1.1.9? If the latter is the case then use this hotfix:

--- lib/Foswiki/Plugins/WysiwygPlugin/Constants.pm    2013-05-29 13:37:25.077642257 +0200
+++ lib/Foswiki/Plugins/WysiwygPlugin/Constants.pm      2014-05-22 16:10:40.000000000 +0200
@@ -328,7 +328,7 @@
         }
     }
     HTML::Entities::_decode_entities( $_[0], $representable_entities );
-    $_[0] = Encode::encode( encoding(), $_[0] );
+#    $_[0] = Encode::encode( encoding(), $_[0] );
     return $_[0];
 }

-- MichaelDaum - 14 Apr 2015

My testing wiki says: This site is running Foswiki release Foswiki-1.2.0_Beta_1, Plugin API version 2.3 (the tarbal no github fixes)

-- JozefMojzis - 14 Apr 2015

Try this now:

diff --git a/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/WC.pm b/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/WC.pm
index a68540b..cb1557f 100644
--- a/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/WC.pm
+++ b/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/WC.pm
@@ -429,7 +429,7 @@ sub decodeRepresentableEntities {
         $encoded_nbsp = Encode::encode( WC::site_encoding(), $encoded_nbsp );
     }
     HTML::Entities::_decode_entities( $_[0], $representable_entities );
-    $_[0] = Encode::encode( WC::site_encoding(), $_[0] );
+#    $_[0] = Encode::encode( WC::site_encoding(), $_[0] );
 
     # Replace expansion of   with $WC::NBSP
     $_[0] =~ s/$encoded_nbsp/$WC::NBSP/g;
lines 1-13/13 (END)

-- MichaelDaum - 14 Apr 2015

The patch was almost right smile

-- CrawfordCurrie - 20 Apr 2015

 

ItemTemplate edit

Summary Encoding problems (utf8) on Macro arguments
ReportedBy JozefMojzis
Codebase 1.2.0 beta1
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:c708d5240fcb distro:ea8662abc78c
TargetRelease minor
ReleasedIn 1.2.0
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:c708d5240fcb distro:ea8662abc78c
ItemBranchCheckins
Release01x01Checkins
Topic attachments
I Attachment Action Size Date Who Comment
screenshot_57.pngpng screenshot_57.png manage 37 K 14 Apr 2015 - 00:31 JozefMojzis  
screenshot_59.pngpng screenshot_59.png manage 29 K 14 Apr 2015 - 00:31 JozefMojzis  
Topic revision: r6 - 20 Apr 2015, CrawfordCurrie - This page was cached on 08 Dec 2016 - 03:49.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License