Chas. Owens schrieb:
On Thu, Jul 28, 2016 at 10:05 AM, hw <h...@gc-24.de> wrote:
snip
So which character encoding on STDOUT does perl use by default?  That should
be utf-8 without any further ado, shouldn´t it?  When I add


binmode STDOUT, ":encoding(utf-8)";


the characters are displayed correctly in the terminal.  Why would perl use
something else than utf-8 by default?

Take the following with a grain of salt.  My knowledge is mostly
hearsay and supposition with a dash of cargo cultism on this matter.

Perl predates even Unicode (they both came out in '87).  Unicode did
not get much traction until the mid-nineties when people started
realizing that UTF-8 (created in '92) was a good thing.   So, for most
of its early history, Perl used Latin1.  It still does to a large
extent for backwards compatibility reasons.  To make Perl 5 a proper
UTF-8 environment there are a number of knobs to pull and buttons to
poke.

You may find this video from YAPC NA 2016 enlightening:
https://www.youtube.com/watch?v=TmTeXcEixEg

Others that may be helpful (I haven't watched them, but I trust the speaker):

https://www.youtube.com/watch?v=iZgqhVu72zc
https://www.youtube.com/watch?v=X2FQHUHjo8M

Also, this answer on StackOverflow by tchrist (Tom Christiansen, who I
would say knows the most about the intersection of Perl and Unicode)
is a good resource: http://stackoverflow.com/a/6163129/78259

Hope this helps.

Thanks!  That makes it really complicated to write applications which display
data from a database via a web browser --- yet ppl are doing this since a pretty
long time now.  But no matter what I do, Umlaute are not displayed correctly
throughout the whole web page: they are either wrong in the data from the
database or in print statements or in the output of the CGI::FormBuilder.
There´s probably no way to get it right :(


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to