Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: IO::Handle Unicode and ungetc()

by quester (Vicar)
on Jan 06, 2013 at 06:28 UTC ( #1011836=note: print w/ replies, xml ) Need Help??


in reply to IO::Handle Unicode and ungetc()

You can work around this by adding a call to binmode just after the open,

$fh->open(\$string, '<:encoding(UTF-8)'); binmode $fh;

However, that only works if you do NOT use either of the ":utf8" or ":encoding(UTF-8)" options on binmode. I'm not that familiar with perl Unicode, but this seems vaguely bug-ish to me offhand.

Update: tested on perl v5.14.3 built for x86_64-linux-thread-multi


Comment on Re: IO::Handle Unicode and ungetc()
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (18)
As of 2015-07-30 16:15 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 (273 votes), past polls