[MKDoc-commit] Reverting Sam's last commit since it stops UTF-8 working.

chris at mkdoc.demon.co.uk chris at mkdoc.demon.co.uk
Mon Jul 3 10:23:01 BST 2006


Log Message:
-----------
Reverting Sam's last commit since it stops UTF-8 working.
This is the commit that this is rolling back:
https://lists.webarch.co.uk/pipermail/mkdoc-commit/2006-June/001128.html
And this is the bug:
http://www.mkdoc.org/bugs/stable/normal/perl-588/

Tags:
----
mkdoc-1-6

Modified Files:
--------------
    mkd/flo:
        Component.pm

-------------- next part --------------
Index: Component.pm
===================================================================
RCS file: /var/spool/cvs/mkd/flo/Component.pm,v
retrieving revision 1.3.2.41
retrieving revision 1.3.2.42
diff -Lflo/Component.pm -Lflo/Component.pm -u -r1.3.2.41 -r1.3.2.42
--- flo/Component.pm
+++ flo/Component.pm
@@ -647,11 +647,9 @@
             $res;
         };
 
-        # decode UTF8 in the returned structure
-        _decode_hash($obj);
-        
-        for (keys %{$obj}) {
-            $self->{$_} = $obj->{$_};
+        for (keys %{$obj})
+        {
+            $self->{$_} = Encode::decode_utf8  ($obj->{$_} );
         }
 
         $self->__on_load() if ($self->can ('__on_load'));
@@ -660,22 +658,6 @@
     $@ and warn "== $@ ==";
 }
 
-# passes all scalars in a hash-ref through decode_utf8, recursing on
-# included hashes and ignoring other refs.  This is needed because as
-# of Encode v2.10 references will get stringified instead of being
-# passed-through as in earlier versions.
-sub _decode_hash {
-    my $hash = shift;
-    foreach my $key (keys %$hash) {
-        my $ref = ref $hash->{$key};
-        if ($ref and $ref eq 'HASH') {
-            _decode_hash($hash->{$key});
-        } elsif (not $ref) {
-            $hash->{$key} = Encode::decode_utf8($hash->{$key});
-        }
-    }
-}
-
 # determine contents of the Move button target select list, correcting
 # for placement, minimum and maximum
 sub move_targets {


More information about the MKDoc-commit mailing list