てきとうなメモ

本の感想とか技術メモとか

use encodingは使わない

古いコードの移植でuse encoding 'euc-jp'を使っていたらいろいろはまってしまった。使わない方が良いね。以前からいろいろ言われていたし。

あと、Programming Perl(4th edition)をこの間購入したら、こちらにも書かれてあった。

encoding

... However, it has never worked correctly and probably never can. Instead, convert your source code from whatever legacy encoding you were using into UTF-8, and put a use utf8 dec- laration at the top of the file. Set your standard I/O streams using the open pragma or with binmode.

use utf8,use open, binmodeを使いましょうとのこと。

3rd editionは内容がv5.6なのでUnicode関係の話はあまりなかったけど、4th editionはv5.14なのでUnicodeに1章ほど割くようになっている。

Programming Perl

Programming Perl