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章ほど割くようになっている。
- 作者: Tom Christiansen,Brian D. Foy,Larry Wall,Jon Orwant
- 出版社/メーカー: Oreilly & Associates Inc
- 発売日: 2012/03/06
- メディア: ペーパーバック
- クリック: 6回
- この商品を含むブログ (2件) を見る