develooper Front page | perl.perl5.porters | Postings from October 2000

non-unicode output from XML::Parser

Thread Next
From:
Hugo
Date:
October 30, 2000 06:11
Subject:
non-unicode output from XML::Parser
Message ID:
200010301413.OAA15476@crypt.compulink.co.uk
I have a unicode string (created by XML::Parser) that I need to output
as iso-8859-1. In perl-5.6.0, I can tr/\0-\x{ff}//UC and it works fine.
In perl-5.7.0 (and bleadperl) I'm not sure what I can do: I think some
pack/unpack command should do it, but I'm sure I shouldn't have to
  pack "C*", unpack "U*", $string
should I?

For code that should work in both 5.6.0 and future versions, what is
the correct way to write this?

I also note that the my latest installed bleadperl (around @7385) causes
test failures in XML::Parser, where it is trying to check that it had the
right bytes in its unicode:

t/encoding..........FAILED tests 2, 4                                        
t/parament..........FAILED test 7                                            

I think these failures relate to the recent discussion (most of which
I didn't understand) of when $a eq $b should be true.

Hugo

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About