Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
laziness, impatience, and hubris
 
PerlMonks  

Re: Decoding UTF-16 to ASCII

by fauria (Deacon)
on Feb 02, 2005 at 17:13 UTC ( [id://427450]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Decoding UTF-16 to ASCII

Using a CPAN module for parsing XML is a good idea.

XML::Simple is really simple to use. Just:
use XML::Simple; use Data::Dumper; my $xml_hashref = XMLin($file); print Dumper $xml_hashref; #Just to see how it is structured

Then, you can iterate over the hasref, and translate one space into no-space, and two spaces into one:

$xml_hashref->{tag1}->{nested_tag}{value} =~ s/\s//gs


This node describes how to iterate hashrefs.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427450]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.