in reply to Re: How to handle encodings?
in thread How to handle encodings?
I've looked att the Encoding::Guess module, is this an option to decide the format of the incoming data?No. Guessing encoding is not reliable, and you should avoid it by all means. Make sure that all your interfaces have a way to specify the encoding.
I wouldn't be so harsh on Encode::Guess. It definitely can be useful when applied correctly to the right problems, and I think its man page does an okay job of saying what its strengths and weaknesses are.
I agree that using it as a "do-all" for every multi-encoding task would be wrong; ideally, all your inputs will provide some sort of declarative or unambiguous evidence about the encoding being used, but for inputs that don't provide that, you may need all the help you can get (doing "offline" research/investigation to understand the data) in order to figure out what encoding the data is using, and Encode::Guess can help in such cases.
Once you understand your data well enough, and you understand how Encode::Guess handles it, you may actually find it worthwhile to use the module in a production pipeline, to route data according to what the module can tell you about it (in the absence of any other information) -- but doing so without thorough testing would be a mistake.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to handle encodings?
by clinton (Priest) on Mar 07, 2009 at 19:06 UTC | |
by Narveson (Chaplain) on Mar 07, 2009 at 22:28 UTC |