diff options
author | Karl Williamson <khw@cpan.org> | 2015-03-02 22:08:41 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-03-09 15:19:58 -0600 |
commit | a7a22abc1654ce1bee21c7bb8657a3b7c07ae25a (patch) | |
tree | b8a6be2af7d822fe96f5d6923fddd7e541936a3e /lib | |
parent | 96c7b11637ff39945439a12d8537de89dba86bde (diff) | |
download | perl-a7a22abc1654ce1bee21c7bb8657a3b7c07ae25a.tar.gz |
DBM_Filter/t/utf8.t: Generalize for other EBCDIC code pages
This worked for EBCDIC 1047, but not for other pages. This commit
changes to use the tools created for the purpose to make it general.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/DBM_Filter/t/utf8.t | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/lib/DBM_Filter/t/utf8.t b/lib/DBM_Filter/t/utf8.t index 0bc38f8603..fb290e956b 100644 --- a/lib/DBM_Filter/t/utf8.t +++ b/lib/DBM_Filter/t/utf8.t @@ -6,6 +6,8 @@ use Carp; BEGIN { + require "../t/charset_tools.pl"; + eval { require Encode; }; if ($@) { @@ -79,23 +81,13 @@ my $db2 = tie(%h2, $db_file,'Op_dbmx', O_RDWR|O_CREAT, 0640) ; ok $db2, "tied to $db_file"; -if (ord('A') == 193) { # EBCDIC. - VerifyData(\%h2, - { - 'alpha' => "\xB4\x58", - 'beta' => "\xB4\x59", - "\xB4\x62"=> "gamma", - "" => "", - }); -} else { - VerifyData(\%h2, - { - 'alpha' => "\xCE\xB1", - 'beta' => "\xCE\xB2", - "\xCE\xB3"=> "gamma", - "" => "", - }); -} +VerifyData(\%h2, + { + 'alpha' => byte_utf8a_to_utf8n("\xCE\xB1"), + 'beta' => byte_utf8a_to_utf8n("\xCE\xB2"), + byte_utf8a_to_utf8n("\xCE\xB3")=> "gamma", + "" => "", + }); undef $db2; { |