Perl 5.16 vs Ruby 2.0 UTF-8 support

James Laver james.laver at gmail.com
Fri Aug 23 19:45:28 BST 2013


On Fri, Aug 23, 2013 at 5:37 PM, Nic Gibson <nicg at corbas.co.uk> wrote:
>
> If you are seeing this in your then your code is either a) not encoded as ASCII (probably Latin-1 or UTF-8) or b) broken

If you're seeing this in client-provided CSV, I recommend running a mile.

Notes from the recent frontiers:
- Excel windows exports as wincp1252 with \r\n line endings
- Excel mac exports as macroman (yes, in 2013!) with \r line endings
- UTF-8 is a great interchange format. But it's quite annoying perl
doesn't have a flag to automatically en/decode to/from UTF-8 as
regards STDIN and STDOUT (and in the case of STDIN, probably anything
that <> uses)
- iconv is awesome! Here are some handy aliases:
alias utf8tolatin1="iconv -f utf-8 -t iso-8859-1"
alias win1252toutf8="iconv -f windows-1252 -t utf-8"
alias utf8towin1252="iconv -f utf-8 -t windows-1252"

(a rather grumpy) James (who is sat on a client site at this hour
thanks to aforementioned CSV)


More information about the london.pm mailing list