Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Encoding and decoding a Unicode

by andal (Hermit)
on Jul 13, 2015 at 07:25 UTC ( #1134456=note: print w/replies, xml ) Need Help??


in reply to Encoding and decoding a Unicode

First of all, there's small bug in your code. When you pass content of the file through decoding process (via 'encoding' directive), you get "characters". You should not pass those characters to STDOUT, because by default it expects "octets" instead of "characters". Well, it kinda works if your text contains only English alphabet, but it won't work properly for other characters.

Second, your question is not clear. In the second block of code you use '$currentline', which is also used in the first block, is it the same variable, or different one? Maybe you can provide real block of code that produces problems, then it would be possible to see where you make mistake. Otherwise, as already recommended, try to read 'perldoc Encode'.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-01-18 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (53 votes). Check out past polls.

    Notices?