Juman::Encode3pm
Character encoding functions
Overview
Perl-5.8.x は内部文字コードとして Unicode を採用している.そのため,日 本語 EUC を使っているプロセスとの入出力を行う場合や,日本語 EUC で記述 されたデータを参照する場合には,常に明示的に encode/decode を行う必要 がある.
このライブラリでは,そのための関数を定義している.
Functions
$octets = encode ( $string )
|
文字列を, |
|---|---|
$string = decode ( $octets )
|
バイト列を, |
set_encoding ( $handle )
|
指定されたファイルハンドルとの通信に, |
いずれの関数も,"encoding" プラグマが指定されていない場合には,何もし ない.
Memo
このライブラリは,変数 "${^ENCODING}" を参照する必要のある関数の定義 を,一ヶ所にまとめるために導入した.なぜならば,変数 "${^ENCODING}" を参照しようとするコードは,Jperl-5.005 では syntax error となるためで ある.
Sample Script:use English qw/ $PERL_VERSION /;if( $PERL_VERSION > 5.008 ){${^ENCODING}->encode( ... );}Error Message:syntax error at sample.perl line 3, near "{^"
Pod errors
Hey! The above document had some coding errors, which are explained below:
Around line 14:
|
Non-ASCII character seen before =encoding in 'は内部文字コードとして'. Assuming UTF-8 |
|---|---|
Around line 108:
|
=over without closing =back |
Releases
5 releases since Debian 8 (Jessie); the text changed 3 times.