Thread Byte raw format in String umwandeln (Glib::IO::File->get_contents) (18 answers)
Opened by Max_Perlbeginner at 2016-05-31 10:53

Raubtier
 2016-05-31 21:08
#184863 #184863
User since
2012-05-04
1054 Artikel
BenutzerIn

user image
Guest janus
1) gar nichts


?!!!

Natürlich macht "use utf8" etwas. Es bezieht sich allerdings nicht auf das, was das Script einliest oder ausgibt, sondern in welcher Kodierung das Script selbst geschrieben ist.

Also
Code (perl): (dl )
1
2
use utf8;
$string = "Hallöle";


String-Werte, die direkt im Script stehen, werden mit "use utf8" automatisch dekodiert. Siehe auch Perldoc:utf8, insbesondere das Zitat:
perldoc utf8
Do not use this pragma for anything else than telling Perl that your script is written in UTF-8.

und
Quote
Enabling the utf8 pragma has the following effect:
Bytes in the source text that are not in the ASCII character set will be treated as being part of a literal UTF-8 sequence. This includes most literals such as identifier names, string constants, and constant regular expression patterns.

View full thread Byte raw format in String umwandeln (Glib::IO::File->get_contents)