1N/A print "1..0 # Skip: no utf8 hash key support\n"; 1N/A chdir('t') if -d 't'; 1N/A # Look, I'm using this fully-qualified variable more than once! 1N/A print "1..0 # Skip: Storable was not built\n"; 1N/A# Better than no plan, because I was getting out of memory errors, at which 1N/A# point Test::More tidily prints up 1..79 as if I meant to finish there. 1N/A# first we generate a nasty hash which keys include both utf8 1N/A# on and off with identical PVs 1N/Ano utf8; # we have a naked 8-bit byte below (in Latin 1, anyway) 1N/A# In Latin 1 -ese the below ord() should end up 0xc0 (192), 1N/A ord("�"), # LATIN CAPITAL LETTER A WITH GRAVE 1N/A 0x3000, #IDEOGRAPHIC SPACE 1N/A # warn sprintf "%d,%d", bytes::length($u), is_utf8($u); 1N/A # warn sprintf "%d,%d" ,bytes::length($b), is_utf8($b); 1N/A "equivalence - with utf8flag"); 1N/A "equivalence - without utf8flag"); 1N/A "nasty hash generated (nkeys=$nk)"); 1N/A# now let the show begin! 1N/A "scalar keys \%{\$thawed} (nkeys=$nk)"); 1N/A "scalar keys \%{\$retrieved} (nkeys=$nk)"); 1N/A "scalar keys \%{\$retrieved} (nkeys=$nk)"); 1N/A# On the premis that more tests are good, here are NWC's tests: 1N/A# Set this to 1 to test the test by bypassing Storable. 1N/A is $@, "", "check it has correct method"; 1N/A# Thanks to Dan Kogai for the Kanji for "castle" (which he informs me also 1N/A# means 'a city' in Mandarin). 1N/Amy %hash = (map {$_, $_} 'castle', "ch\xe5teau", $utf8, "\x{57CE}"); 1N/A # Run through and sanity check these. 1N/A my $l = 0 + /^\w+$/; 1N/A # Grr. This cperl mode thinks that ${ is a punctuation variable. 1N/A # I presume it's punishment for using xemacs rather than emacs. Or OS/2 :-) 1N/A my $l = 0 + /^\w+$/;