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

Re: Decode character encodings, warn on user mistake

by merlyn (Sage)
on Dec 22, 2009 at 16:24 UTC ( #813922=note: print w/ replies, xml ) Need Help??


in reply to Decode character encodings, warn on user mistake

Did you find Encode::Guess unsuitable? Or is this doing a different task?

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.


Comment on Re: Decode character encodings, warn on user mistake
Re^2: Decode character encodings, warn on user mistake
by ambrus (Abbot) on Dec 22, 2009 at 17:17 UTC

    Yes, using Encode::Guess might have worked too I suppose. That would require restricting myself to reading the whole input at once, but that wouldn't be too bad in this application anyway. However, if I read the whole input at once, that would have simplified my code a great deal too, and in that case I don't think Encode::Guess would have helped much compared to just testing for utf-8 and ascii input by hand. This code I can at least reuse later if I really need to read character encoded text data one line at a time in some program.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2014-12-19 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (83 votes), past polls