Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: tr{}{} doesn't wanna work.. what am I doing wrong?

by ultranerds (Friar)
on Feb 24, 2012 at 14:18 UTC ( #955925=note: print w/ replies, xml ) Need Help??


in reply to Re: tr{}{} doesn't wanna work.. what am I doing wrong?
in thread tr{}{} doesn't wanna work.. what am I doing wrong?

Hi, Thanks for your suggestion :) For some reason it gives me a weird output, compared to yours?

C:\Users\Andy>perl test2.pl Malformed UTF-8 character (unexpected non-continuation byte 0xc2, imme +diately after start byte 0xc0) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xc4, imme +diately after start byte 0xc2) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xe0, imme +diately after start byte 0xc4) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xe2, imme +diately after start byte 0xe0) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xe4, imme +diately after start byte 0xe2) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xc7, imme +diately after start byte 0xe4) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xe7, imme +diately after start byte 0xc7) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xc9, imme +diately after start byte 0xe7) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xca, imme +diately after start byte 0xc9) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xc8, imme +diately after start byte 0xca) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xcb, imme +diately after start byte 0xc8) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xe9, imme +diately after start byte 0xcb) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xea, imme +diately after start byte 0xe9) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xe8, imme +diately after start byte 0xea) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xeb, imme +diately after start byte 0xe8) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xcf, imme +diately after start byte 0xeb) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xcc, imme +diately after start byte 0xcf) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xce, imme +diately after start byte 0xcc) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xef, imme +diately after start byte 0xce) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xec, imme +diately after start byte 0xef) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xee, imme +diately after start byte 0xec) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xd6, imme +diately after start byte 0xee) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xd4, imme +diately after start byte 0xd6) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xd2, imme +diately after start byte 0xd4) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xf6, imme +diately after start byte 0xd2) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xf4, imme +diately after start byte 0xf6) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xf2, imme +diately after start byte 0xf4) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xdc, imme +diately after start byte 0xf2) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xdb, imme +diately after start byte 0xdc) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xd9, imme +diately after start byte 0xdb) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xfc, imme +diately after start byte 0xd9) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xfb, imme +diately after start byte 0xfc) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xf9, imme +diately after start byte 0xfb) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0x3f, imme +diately after start byte 0xf9) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected continuation byte 0xab, with no +preceding start byte) in subroutine entry at test2.pl line 10. Malformed UTF-8 character (unexpected continuation byte 0xbb, with no +preceding start byte) in subroutine entry at test2.pl line 10. Malformed UTF-8 character (unexpected non-continuation byte 0xf3, imme +diately after start byte 0xed) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xf1, imme +diately after start byte 0xf3) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xd1, imme +diately after start byte 0xf1) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xe1, imme +diately after start byte 0xd1) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xe9, imme +diately after start byte 0xe1) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xf3, imme +diately after start byte 0xe9) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xfa, imme +diately after start byte 0xf3) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xc1, imme +diately after start byte 0xfa) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xc9, imme +diately after start byte 0xc1) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xcd, imme +diately after start byte 0xc9) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0xd3, imme +diately after start byte 0xcd) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (unexpected non-continuation byte 0x0a, imme +diately after start byte 0xd3) in subroutine entry at test2.pl line 1 +0. Malformed UTF-8 character (1 byte, need 2, after start byte 0xda) in s +ubroutine entry at test2.pl line 10. _[]__________________________________________________________ C:\Users\Andy>
Any ideas? TIA! Andy


Comment on Re^2: tr{}{} doesn't wanna work.. what am I doing wrong?
Download Code
Re^3: tr{}{} doesn't wanna work.. what am I doing wrong?
by Corion (Pope) on Feb 24, 2012 at 14:24 UTC

    Check the encoding of your input data. Decode all data (to unicode) before operating on it in any way.

      Thanks, that did the trick :) I needed to convert $filename:

      utf8::decode($filename);

      Working like a charm now - thanks! :)
Re^3: tr{}{} doesn't wanna work.. what am I doing wrong?
by moritz (Cardinal) on Feb 24, 2012 at 14:36 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2015-07-06 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls