good chemistry is complicated,
and a little bit messy -LW
why no default unicode?by perl-diddler (Hermit)
|on Mar 19, 2011 at 23:02 UTC||Need Help??|
perl-diddler has asked for the
wisdom of the Perl Monks concerning the following question:
I'm often getting confused by unicode issues -- about when a file stream is in unicode vs. not, but the latest is in a terminal interactive prog where I tried to print a unicode character and got a 'wide-char' error.
Of course I can easily work-around the problem by adding:
to the beginning of my program, but I'm not sure why it isn't *defaulting*. to UTF-8.
I'm running from windows to linux using SecureCRT, which, in its session options, has its 'character encoding' set to UTF-8.
When I log in, if I type locale, I get:
That **looks** like it's saying UTF-8 for a character encoding (this is a Suse11.2 system I'm logging into, BTW, from a Win7 (i.e. unicode supporting) system).
So why is perl *defaulting* to STDOUT being non-unicode?
Why do I need the binmode?
Sorry if this is unicode-first-grade, but this stuff looks like it should be so 'simple' -- yet *blech*. I've had other issues when operating on 'internet data' where I've experienced UTF nightmares, since you don't know the character encoding of the website's response until you look at the header -- which I worked around mostly until perl worked itself into a serious coredump about 3,500,000 statements / 70,000 data lines statements into the program (to which some suggested I get to know "perl -d " ... *cough* ...I do, but not um...trying to track that down -- I just shelved the program to wait for a more reliable perl (I did, FWIW, file a bug against Perl, that has yet to be addressed that I know of).
Any idea why perl isn't just 'doing the right thing' as it is so famous for doing? Thanks...