UNICOS: since $] is really 5.00700299999997,
[p5sagit/p5-mst-13.2.git] / ext / Storable / t / downgrade.t
1 #!./perl -w
2
3 #
4 #  Copyright 2002, Larry Wall.
5 #
6 #  You may redistribute only under the same terms as Perl 5, as specified
7 #  in the README file that comes with the distribution.
8 #
9
10 # I ought to keep this test easily backwards compatible to 5.004, so no
11 # qr//;
12
13 # This test checks downgrade behaviour on pre-5.8 perls when new 5.8 features
14 # are encountered.
15
16 sub BEGIN {
17     if ($ENV{PERL_CORE}){
18         chdir('t') if -d 't';
19         @INC = ('.', '../lib');
20     } else {
21         unshift @INC, 't';
22     }
23     require Config; import Config;
24     if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
25         print "1..0 # Skip: Storable was not built\n";
26         exit 0;
27     }
28 }
29
30 use Test::More;
31 use Storable 'thaw';
32
33 use strict;
34 use vars qw(@RESTRICT_TESTS %R_HASH %U_HASH $UTF8_CROAK $RESTRICTED_CROAK);
35
36 @RESTRICT_TESTS = ('Locked hash', 'Locked hash placeholder',
37                    'Locked keys', 'Locked keys placeholder',
38                   );
39 %R_HASH = (perl => 'rules');
40
41 if ($] > 5.007002) {
42   # This is cheating. "\xdf" in Latin 1 is beta S, so will match \w if it
43   # is stored in utf8, not bytes.
44   # "\xdf" is y diaresis in EBCDIC (except for cp875, but so far no-one seems
45   # to use that) which has exactly the same properties for \w
46   # So the tests happen to pass.
47   my $utf8 = "Schlo\xdf" . chr 256;
48   chop $utf8;
49
50   # \xe5 is V in EBCDIC. That doesn't have the same properties w.r.t. \w as
51   # an a circumflex, so we need to be explicit.
52
53   # and its these very properties we're trying to test - an edge case
54   # involving whether scalars are being stored in bytes or in utf8.
55   my $a_circumflex = (ord ('A') == 193 ? "\x47" : "\xe5");
56   %U_HASH = (map {$_, $_} 'castle', "ch${a_circumflex}teau", $utf8, chr 0x57CE);
57   plan tests => 169;
58 } elsif ($] >= 5.006) {
59   plan tests => 59;
60 } else {
61   plan tests => 67;
62 }
63
64 $UTF8_CROAK = qr/^Cannot retrieve UTF8 data in non-UTF8 perl/;
65 $RESTRICTED_CROAK = qr/^Cannot retrieve restricted hash/;
66
67 my %tests;
68 {
69   local $/ = "\n\nend\n";
70   while (<DATA>) {
71     next unless /\S/s;
72     unless (/begin ([0-7]{3}) ([^\n]*)\n(.*)$/s) {
73       s/\n.*//s;
74       warn "Dodgy data in section starting '$_'";
75       next;
76     }
77     next unless oct $1 == ord 'A'; # Skip ASCII on EBCDIC, and vice versa
78     my $data = unpack 'u', $3;
79     $tests{$2} = $data;
80   }
81 }
82
83 # use Data::Dumper; $Data::Dumper::Useqq = 1; print Dumper \%tests;
84 sub thaw_hash {
85   my ($name, $expected) = @_;
86   my $hash = eval {thaw $tests{$name}};
87   is ($@, '', "Thawed $name without error?");
88   isa_ok ($hash, 'HASH');
89   ok (defined $hash && eq_hash($hash, $expected),
90       "And it is the hash we expected?");
91   $hash;
92 }
93
94 sub thaw_scalar {
95   my ($name, $expected) = @_;
96   my $scalar = eval {thaw $tests{$name}};
97   is ($@, '', "Thawed $name without error?");
98   isa_ok ($scalar, 'SCALAR', "Thawed $name?");
99   is ($$scalar, $expected, "And it is the data we expected?");
100   $scalar;
101 }
102
103 sub thaw_fail {
104   my ($name, $expected) = @_;
105   my $thing = eval {thaw $tests{$name}};
106   is ($thing, undef, "Thawed $name failed as expected?");
107   like ($@, $expected, "Error as predicted?");
108 }
109
110 sub test_locked_hash {
111   my $hash = shift;
112   my @keys = keys %$hash;
113   my ($key, $value) = each %$hash;
114   eval {$hash->{$key} = reverse $value};
115   like( $@, qr/^Modification of a read-only value attempted/,
116         'trying to change a locked key' );
117   is ($hash->{$key}, $value, "hash should not change?");
118   eval {$hash->{use} = 'perl'};
119   like( $@, qr/^Attempt to access disallowed key 'use' in a restricted hash/,
120         'trying to add another key' );
121   ok (eq_array([keys %$hash], \@keys), "Still the same keys?");
122 }
123
124 sub test_restricted_hash {
125   my $hash = shift;
126   my @keys = keys %$hash;
127   my ($key, $value) = each %$hash;
128   eval {$hash->{$key} = reverse $value};
129   is( $@, '',
130         'trying to change a restricted key' );
131   is ($hash->{$key}, reverse ($value), "hash should change");
132   eval {$hash->{use} = 'perl'};
133   like( $@, qr/^Attempt to access disallowed key 'use' in a restricted hash/,
134         'trying to add another key' );
135   ok (eq_array([keys %$hash], \@keys), "Still the same keys?");
136 }
137
138 sub test_placeholder {
139   my $hash = shift;
140   eval {$hash->{rules} = 42};
141   is ($@, '', 'No errors');
142   is ($hash->{rules}, 42, "New value added");
143 }
144
145 sub test_newkey {
146   my $hash = shift;
147   eval {$hash->{nms} = "http://nms-cgi.sourceforge.net/"};
148   is ($@, '', 'No errors');
149   is ($hash->{nms}, "http://nms-cgi.sourceforge.net/", "New value added");
150 }
151
152 # $Storable::DEBUGME = 1;
153 thaw_hash ('Hash with utf8 flag but no utf8 keys', \%R_HASH);
154
155 if (eval "use Hash::Util; 1") {
156   print "# We have Hash::Util, so test that the restricted hashes in <DATA> are valid\n";
157   for $Storable::downgrade_restricted (0, 1, undef, "cheese") {
158     my $hash = thaw_hash ('Locked hash', \%R_HASH);
159     test_locked_hash ($hash);
160     $hash = thaw_hash ('Locked hash placeholder', \%R_HASH);
161     test_locked_hash ($hash);
162     test_placeholder ($hash);
163
164     $hash = thaw_hash ('Locked keys', \%R_HASH);
165     test_restricted_hash ($hash);
166     $hash = thaw_hash ('Locked keys placeholder', \%R_HASH);
167     test_restricted_hash ($hash);
168     test_placeholder ($hash);
169   }
170 } else {
171   print "# We don't have Hash::Util, so test that the restricted hashes downgrade\n";
172   my $hash = thaw_hash ('Locked hash', \%R_HASH);
173   test_newkey ($hash);
174   $hash = thaw_hash ('Locked hash placeholder', \%R_HASH);
175   test_newkey ($hash);
176   $hash = thaw_hash ('Locked keys', \%R_HASH);
177   test_newkey ($hash);
178   $hash = thaw_hash ('Locked keys placeholder', \%R_HASH);
179   test_newkey ($hash);
180   local $Storable::downgrade_restricted = 0;
181   thaw_fail ('Locked hash', $RESTRICTED_CROAK);
182   thaw_fail ('Locked hash placeholder', $RESTRICTED_CROAK);
183   thaw_fail ('Locked keys', $RESTRICTED_CROAK);
184   thaw_fail ('Locked keys placeholder', $RESTRICTED_CROAK);
185 }
186
187 if ($] >= 5.006) {
188   print "# We have utf8 scalars, so test that the utf8 scalars in <DATA> are valid\n";
189   print "# These seem to fail on 5.6 - you should seriously consider upgrading to 5.6.1\n" if $] == 5.006;
190   thaw_scalar ('Short 8 bit utf8 data', "\xDF");
191   thaw_scalar ('Long 8 bit utf8 data', "\xDF" x 256);
192   thaw_scalar ('Short 24 bit utf8 data', chr 0xC0FFEE);
193   thaw_scalar ('Long 24 bit utf8 data', chr (0xC0FFEE) x 256);
194 } else {
195   print "# We don't have utf8 scalars, so test that the utf8 scalars downgrade\n";
196   thaw_fail ('Short 8 bit utf8 data', $UTF8_CROAK);
197   thaw_fail ('Long 8 bit utf8 data', $UTF8_CROAK);
198   thaw_fail ('Short 24 bit utf8 data', $UTF8_CROAK);
199   thaw_fail ('Long 24 bit utf8 data', $UTF8_CROAK);
200   local $Storable::drop_utf8 = 1;
201   my $bytes = thaw $tests{'Short 8 bit utf8 data as bytes'};
202   thaw_scalar ('Short 8 bit utf8 data', $$bytes);
203   thaw_scalar ('Long 8 bit utf8 data', $$bytes x 256);
204   $bytes = thaw $tests{'Short 24 bit utf8 data as bytes'};
205   thaw_scalar ('Short 24 bit utf8 data', $$bytes);
206   thaw_scalar ('Long 24 bit utf8 data', $$bytes x 256);
207 }
208
209 if ($] > 5.007002) {
210   print "# We have utf8 hashes, so test that the utf8 hashes in <DATA> are valid\n";
211   my $hash = thaw_hash ('Hash with utf8 keys', \%U_HASH);
212   for (keys %$hash) {
213     my $l = 0 + /^\w+$/;
214     my $r = 0 + $hash->{$_} =~ /^\w+$/;
215     cmp_ok ($l, '==', $r, sprintf "key length %d", length $_);
216     cmp_ok ($l, '==', $_ eq "ch\xe5teau" ? 0 : 1);
217   }
218   if (eval "use Hash::Util; 1") {
219     print "# We have Hash::Util, so test that the restricted utf8 hash is valid\n";
220   my $hash = thaw_hash ('Locked hash with utf8 keys', \%U_HASH);
221     for (keys %$hash) {
222       my $l = 0 + /^\w+$/;
223       my $r = 0 + $hash->{$_} =~ /^\w+$/;
224       cmp_ok ($l, '==', $r, sprintf "key length %d", length $_);
225       cmp_ok ($l, '==', $_ eq "ch\xe5teau" ? 0 : 1);
226     }
227     test_locked_hash ($hash);
228   } else {
229     print "# We don't have Hash::Util, so test that the utf8 hash downgrades\n";
230     fail ("You can't get here [perl version $]]. This is a bug in the test.
231 # Please send the output of perl -V to perlbug\@perl.org");
232   }
233 } else {
234   print "# We don't have utf8 hashes, so test that the utf8 hashes downgrade\n";
235   thaw_fail ('Hash with utf8 keys', $UTF8_CROAK);
236   thaw_fail ('Locked hash with utf8 keys', $UTF8_CROAK);
237   local $Storable::drop_utf8 = 1;
238   my $what = $] < 5.006 ? 'pre 5.6' : '5.6';
239   my $expect = thaw $tests{"Hash with utf8 keys for $what"};
240   thaw_hash ('Hash with utf8 keys', $expect);
241   #foreach (keys %$expect) { print "'$_':\t'$expect->{$_}'\n"; }
242   #foreach (keys %$got) { print "'$_':\t'$got->{$_}'\n"; }
243   if (eval "use Hash::Util; 1") {
244     print "# We have Hash::Util, so test that the restricted hashes in <DATA> are valid\n";
245     fail ("You can't get here [perl version $]]. This is a bug in the test.
246 # Please send the output of perl -V to perlbug\@perl.org");
247   } else {
248     print "# We don't have Hash::Util, so test that the restricted hashes downgrade\n";
249     my $hash = thaw_hash ('Locked hash with utf8 keys', $expect);
250     test_newkey ($hash);
251     local $Storable::downgrade_restricted = 0;
252     thaw_fail ('Locked hash with utf8 keys', $RESTRICTED_CROAK);
253     # Which croak comes first is a bit of an implementation issue :-)
254     local $Storable::drop_utf8 = 0;
255     thaw_fail ('Locked hash with utf8 keys', $RESTRICTED_CROAK);
256   }
257 }
258 __END__
259 # A whole run of 2.x nfreeze data, uuencoded. The "mode bits" are the octal
260 # value of 'A', the "file name" is the test name. Use make_downgrade.pl to
261 # generate these.
262 begin 101 Locked hash
263 8!049`0````$*!7)U;&5S!`````1P97)L
264
265 end
266
267 begin 101 Locked hash placeholder
268 C!049`0````(*!7)U;&5S!`````1P97)L#A0````%<G5L97,`
269
270 end
271
272 begin 101 Locked keys
273 8!049`0````$*!7)U;&5S``````1P97)L
274
275 end
276
277 begin 101 Locked keys placeholder
278 C!049`0````(*!7)U;&5S``````1P97)L#A0````%<G5L97,`
279
280 end
281
282 begin 101 Short 8 bit utf8 data
283 &!047`L.?
284
285 end
286
287 begin 101 Short 8 bit utf8 data as bytes
288 &!04*`L.?
289
290 end
291
292 begin 101 Long 8 bit utf8 data
293 M!048```"`,.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?
294 MPY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#
295 MG\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?
296 MPY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#
297 MG\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?
298 MPY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#
299 MG\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?
300 MPY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#
301 MG\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?
302 MPY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#
303 MG\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.?PY_#G\.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OBPC[^N^+"/OZ[XL(^_KOBPC[^N
348
349 end
350
351 begin 101 Hash with utf8 flag but no utf8 keys
352 8!049``````$*!7)U;&5S``````1P97)L
353
354 end
355
356 begin 101 Hash with utf8 keys
357 M!049``````0*!F-A<W1L90`````&8V%S=&QE"@=C:.5T96%U``````=C:.5T
358 D96%U%P/EGXX!`````^6?CA<'4V-H;&_#GP(````&4V-H;&_?
359
360 end
361
362 begin 101 Locked hash with utf8 keys
363 M!049`0````0*!F-A<W1L900````&8V%S=&QE"@=C:.5T96%U!`````=C:.5T
364 D96%U%P/EGXX%`````^6?CA<'4V-H;&_#GP8````&4V-H;&_?
365
366 end
367
368 begin 101 Hash with utf8 keys for pre 5.6
369 M!049``````0*!F-A<W1L90`````&8V%S=&QE"@=C:.5T96%U``````=C:.5T
370 D96%U"@/EGXX``````^6?C@H'4V-H;&_#GP(````&4V-H;&_?
371
372 end
373
374 begin 101 Hash with utf8 keys for 5.6
375 M!049``````0*!F-A<W1L90`````&8V%S=&QE"@=C:.5T96%U``````=C:.5T
376 D96%U%P/EGXX``````^6?CA<'4V-H;&_#GP(````&4V-H;&_?
377
378 end
379
380 begin 301 Locked hash
381 8!049`0````$*!9FDDX6B!`````27A9F3
382
383 end
384
385 begin 301 Locked hash placeholder
386 C!049`0````(.%`````69I).%H@H%F:23A:(`````!)>%F9,`
387
388 end
389
390 begin 301 Locked keys
391 8!049`0````$*!9FDDX6B``````27A9F3
392
393 end
394
395 begin 301 Locked keys placeholder
396 C!049`0````(.%`````69I).%H@H%F:23A:(`````!)>%F9,`
397
398 end
399
400 begin 301 Short 8 bit utf8 data
401 &!047`HMS
402
403 end
404
405 begin 301 Short 8 bit utf8 data as bytes
406 &!04*`HMS
407
408 end
409
410 begin 301 Long 8 bit utf8 data
411 M!048```"`(MSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMS
412 MBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+
413 M<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMS
414 MBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+
415 M<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMS
416 MBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+
417 M<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMS
418 MBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+
419 M<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMS
420 MBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+
421 M<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMS
422 8BW.+<XMSBW.+<XMSBW.+<XMSBW.+<XMS
423
424 end
425
426 begin 301 Short 24 bit utf8 data
427 *!047!OM30G-S50``
428
429 end
430
431 begin 301 Short 24 bit utf8 data as bytes
432 *!04*!OM30G-S50``
433
434 end
435
436 begin 301 Long 24 bit utf8 data
437 M!048```&`/M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
438 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
439 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
440 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
441 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
442 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
443 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
444 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
445 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
446 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
447 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
448 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
449 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
450 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
451 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
452 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
453 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
454 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
455 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
456 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
457 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
458 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
459 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
460 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
461 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
462 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
463 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
464 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
465 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
466 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
467 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
468 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
469 M5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M3
470 M0G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S5?M30G-S
471 -5?M30G-S5?M30G-S50``
472
473 end
474
475 begin 301 Hash with utf8 flag but no utf8 keys
476 8!049``````$*!9FDDX6B``````27A9F3
477
478 end
479
480 begin 301 Hash with utf8 keys
481 M!049``````0*!X.(1Z.%@:0`````!X.(1Z.%@:0*!H.!HJ.3A0`````&@X&B
482 FHY.%%P3<9')5`0````3<9')5%P?B@XB3EHMS`@````;B@XB3EM\`
483
484 end
485
486 begin 301 Locked hash with utf8 keys
487 M!049`0````0*!X.(1Z.%@:0$````!X.(1Z.%@:0*!H.!HJ.3A00````&@X&B
488 FHY.%%P3<9')5!0````3<9')5%P?B@XB3EHMS!@````;B@XB3EM\`
489
490 end
491
492 begin 301 Hash with utf8 keys for pre 5.6
493 M!049``````0*!H.!HJ.3A0`````&@X&BHY.%"@B#B(M&HX6!I``````'@XA'
494 GHX6!I`H'XH.(DY:+<P(````&XH.(DY;?"@3<9')5``````3<9')5
495
496 end
497
498 begin 301 Hash with utf8 keys for 5.6
499 M!049``````0*!H.!HJ.3A0`````&@X&BHY.%"@>#B$>CA8&D``````>#B$>C
500 FA8&D%P?B@XB3EHMS`@````;B@XB3EM\7!-QD<E4`````!-QD<E4`
501
502 end
503