Thread use utf8 und Verhalten von String-Operationen (65 answers)
Opened by rosti at 2011-08-03 19:16

pq
 2011-08-10 18:12
#151491 #151491
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
DESCRIPTION
The "use utf8" pragma tells the Perl parser to allow UTF-8 in the
program text in the current lexical scope (allow UTF-EBCDIC on EBCDIC
based platforms). The "no utf8" pragma tells Perl to switch back to
treating the source text as literal bytes in the current lexical scope.

Do not use this pragma for anything else than telling Perl that your
script is written in UTF-8. The utility functions described below are
directly usable without "use utf8;".

Because it is not possible to reliably tell UTF-8 from native 8 bit
encodings, you need either a Byte Order Mark at the beginning of your
source code, or "use utf8;", to instruct perl.


perl kann ja sonst nicht wissen, dass es das script als utf8 behandeln soll.

Editiert von pq: zitat ergänzt
Last edited: 2011-08-10 18:19:11 +0200 (CEST)
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread use utf8 und Verhalten von String-Operationen