Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Encoding and decoding a Unicode

by afoken (Chancellor)
on Jul 10, 2015 at 12:31 UTC ( [id://1134140]=note: print w/replies, xml ) Need Help??


in reply to Encoding and decoding a Unicode

I tried the below code for decoding but still got empty lines.

Some unexpected empty lines or only empty lines?

Empty lines after (almost) all lines you read? chomp!

#!/usr/bin/perl my $input=$ARGV[0];

Add use strict; and use warnings;. Ignoring perl's debugging aids just wastes everyone's time.

And finally, whenever you think that perl has encoding problems, show us a hex dump of the input and the output.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: Encoding and decoding a Unicode
by suno (Acolyte) on Jul 10, 2015 at 16:26 UTC

    Thanks much for your reply! :-)

    After encoding the unicode file, did some modifications (In the stated example it is all lines other than lines with 'OPEN' or 'CLOSE').

    After this process when i try to decode the encoded lines, i am getting only empty lines for all the read lines.

    I want help in decoding the encoded file.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1134140]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2025-05-22 22:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.