Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^6: Problems w/ encoding in terminal

by humble (Acolyte)
on Aug 31, 2013 at 10:18 UTC ( #1051702=note: print w/replies, xml ) Need Help??


in reply to Re^5: Problems w/ encoding in terminal
in thread Problems w/ encoding in terminal

Exactly! I apologise exceedingly! -- I was watching my files' content encoding always, but this time i missed it. Please pardon me!

Now, how do i tell PERL to warn me on opening non-UTF8 file's content?

I used:

use utf8::all; open $fh, '<', $file || die "sopen: Cann't open $file $!"; binmode $fh, ':encoding(UTF-8)'; do{ $cont.=<$fh>; }until( eof( $fh ) ); close $fh;

But it keeps saying:

utf8 "\xB4" does not map to Unicode at ...

Replies are listed 'Best First'.
Re^7: Problems w/ encoding in terminal
by humble (Acolyte) on Sep 02, 2013 at 09:47 UTC

    Good time of the day.

    Also i wanted to ask, having used the pragma utf8::all, how do i process data that is not in unicode? - I have to save the result of the search by linux command "find" that gives my paths in unicode and non-unicode char.s. Have i to stop using the utf8 module for a moment and then enable and convert all the data to unicode - to work farther w/ it (like regexp-ing)? Or there are other ways?

    Alright, i guess i have better to start a new thread - as the original is complete long ago. :o)
Re^7: Problems w/ encoding in terminal
by humble (Acolyte) on Sep 02, 2013 at 09:52 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1051702]
help
Chatterbox?
[Corion]: A good daystart to everybody!
[Corion]: Just a quick poll - is anybody actively relying on https://perlmonks. pairsite.com/? I plan to retire that URL in favour of moving all our servers onto the same HTTPS certificate for perlmonks.{com, net,org}
[Corion]: Actually bsd_glob '{www.,}perlmonks .{com,net,org}', plus css.perlmonks.org I think
[Corion]: Sad that Let's Encrypt does not allow wildcard certificates, but they could be somewhat of a hassle to verify

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2017-09-26 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (292 votes). Check out past polls.

    Notices?