Hi Paul Here is the verbose output of the test ok 1 - use DBM_Filter; ok 2 - use SDBM_File; ok 3 - use Fcntl; ok 4 - use charnames; ok 5 - tied to SDBM_File ok 6 - push an illigal filter ok 7 - push an 'encode' filter (default to utf-8) ok 8 - StoreData called from lib/DBM_Filter/t/encode.t, line 47 ok 9 - Store Data is a hash reference ok 10 - Storing to tied hash ok 11 - VerifyData called from lib/DBM_Filter/t/encode.t, line 57 ok 12 - Expected data is a hash reference ok 13 - Verifying a tied hash not ok 14 - Expected == Actual # Failed test (/u/isldev3/perl-5.8.6/lib/dbm_filter_util.pl at line 48) Wide character in print at /u/isldev3/perl-5.8.6/lib/Test/Builder.pm line 910. # Expected does not match actual # No Match from Expected: # 'beta' => '(c)ß' # 'alpha' => '(c)ì' # '(c)Â' => 'gamma' # ok 15 - pop the 'utf8' filter ok 16 - push an 'encode' filter (specify iso-8859-16) ok 17 - StoreData called from lib/DBM_Filter/t/encode.t, line 72 ok 18 - Store Data is a hash reference ok 19 - Storing to tied hash ok 20 - untie without inner references ok 21 - tied to SDBM_File ok 22 - VerifyData called from lib/DBM_Filter/t/encode.t, line 90 ok 23 - Expected data is a hash reference ok 24 - Verifying a tied hash not ok 25 - Expected == Actual # Failed test (/u/isldev3/perl-5.8.6/lib/dbm_filter_util.pl at line 48) # Expected does not match actual # No Match from Expected: # 'beta' => 'ó¥' # 'ó·' => 'gamma' # 'alpha' => 'ó£' # 'euro' => 'u' # # No Match from Actual: # '/Ä>,' => 'u' # 'ea' => '(c)ß' # '(c)Â' => 'am' # 'lh' => '(c)ì' # ok 26 - untie without inner references # Looks like you failed 2 tests of 26. On 9/9/05, Paul Marquess <[EMAIL PROTECTED]> wrote: > > Are you saying that the 4 byte string "euro"(ASCII hex 65 75 72 6F) is > being > stored as '/Ä>,' (hex 2F C4 3E 2C) ? > > The value I am getting on EBCDIC is \x61\x63\x6E\x6B which has no > relation to iso-8859-16 codepoints! Do you have any thoughts as why this is > happening?
Can you post the verbose output from running the lib/DBM_Filter/t/encode.t > test harness please? > > See the output above Not sure how different EBDCIC platforms are from Unix-land, but this is how > you would run it on a Linux/Unix box. > > Running the test is similar $ cd t > $ ./TEST -v ../lib/DBM_Filter/t/encode.t > > Paul > > > -----Original Message----- > > From: Sastry [mailto:[EMAIL PROTECTED] > > Sent: 08 September 2005 14:15 > > To: Dan Kogai > > Cc: Perl Porters 5 > > Subject: Re: Encode on EBCDIC patch( Doesn't Work) > > > > Hi Dan > > The patch you had provided calls > > $_ebcdic_coder->decode($str); > > and subsequenly calls my $octets = $enc->encode($string,$check); > > Do you think it is how it is supposed to call on EBCDIC platform? Seems > > like this is a work around > > But there is another test case(lib/DBM_Filter/t/encode.t) in the test > > suite > > that fails because of this encoding module > > Here is the snippet of that test case > > eval { $db1->Filter_Push('encode' => 'iso-8859-16') }; > > is $@, '', "push an 'encode' filter (specify iso-8859-16)" ; > > use charnames qw{:full}; > > StoreData(\%h1, > > { > > 'euro' => "\N{EURO SIGN}", > > }); > > > > VerifyData(\%h2, > > { > > 'euro' => "\xA4", > > > > }); > > The 'euro' gets stored as /Ä>, > > instead of the 'euro' itself. > > Please check if there is a work round for this too or any pointers in > the > > source code where there could be a fix for it! > > -Sastry > > > > > > On 8/24/05, Dan Kogai <[EMAIL PROTECTED]> wrote: > > > > > > Sastry and EBCDIC porters, > > > > > > On Aug 24, 2005, at 21:30 , Dan Kogai wrote: > > > > + sub _utf8_ebcdic($){ > > > > + my $str = shift; # UTF-8 > > > > + $str = # UTF-EBCDIC > > > > + $_ebcdic_coder->encode($str); > > > > + _utf8_on($str); # Dirty Trick > > > > + return $str; > > > > > > I'm not sure if this part works as advertised. The yet another patch > > > below tries the different approach. > > > The problem is that I know so little of UTF-EBCDIC and its > > > implementation. I feel like building a ship in the bottle in the > > > dark.... > > > > > > Dan the Encode Maintainer > > > > > > =================================================================== > > > RCS file: Encode.pm <http://Encode.pm> <http://Encode.pm>,v > > > retrieving revision 2.11 > > > diff -u -r2.11 Encode.pm <http://Encode.pm> <http://Encode.pm> > > > --- Encode.pm <http://Encode.pm> <http://Encode.pm> 2005/08/05 > 10:58:25 2.11 > > > +++ Encode.pm <http://Encode.pm> <http://Encode.pm> 2005/08/24 > 12:49:18 > > > @@ -136,6 +136,27 @@ > > > return Storable::dclone($obj); > > > } > > > +sub _ebcdic_utf8($); > > > +sub _utf8_ebcdic($); > > > + > > > +if ($ON_EBCDIC){ > > > + my %WHICH_EBCDIC = ( 176 => 'cp37', 95 => 'cp1047', 106 => > > > 'posix-bc' ); > > > + my $_ebcdic_coder = find_encoding($WHICH_EBCDIC{ord "^"}); > > > + sub _ebcdic_utf8($){ > > > + my $str = shift; # UTF-EBCDIC > > > + _utf8_off($str); # Dirty Trick > > > + return # UTF-8 > > > + $_ebcdic_coder->decode($str); > > > + } > > > + sub _utf8_ebcdic($){ > > > + my $str = shift; # UTF-8 > > > + $str = # EBCDIC > > > + $_ebcdic_coder->encode($str); > > > + return # UTF-EBCDIC; > > > + find_encoding("Unicode")->decode($str); > > > + } > > > +} > > > + > > > sub encode($$;$) > > > { > > > my ($name, $string, $check) = @_; > > > @@ -147,8 +168,12 @@ > > > require Carp; > > > Carp::croak("Unknown encoding '$name'"); > > > } > > > + $string = _ebcdic_utf8($string) if $ON_EBCDIC; > > > my $octets = $enc->encode($string,$check); > > > - $_[1] = $string if $check and !($check & LEAVE_SRC()); > > > + if ($check and !($check & LEAVE_SRC()) ){ > > > + $string = _utf8_ebcdic($string); > > > + $_[1] = $string; > > > + } > > > return $octets; > > > } > > > @@ -164,6 +189,7 @@ > > > Carp::croak("Unknown encoding '$name'"); > > > } > > > my $string = $enc->decode($octets,$check); > > > + $string = _utf8_ebcdic($string) if $ON_EBCDIC; > > > $_[1] = $octets if $check and !($check & LEAVE_SRC()); > > > return $string; > > > } > > > > > > > > > > ___________________________________________________________ > To help you stay safe and secure online, we've developed the all new > Yahoo! Security Centre. http://uk.security.yahoo.com > >