DBIPgSystem::Code - DBIPgSystemにて文字コードを適切に変換するモジュール
Windows, Mac の機種依存文字を適切に処理しながら、EUCに変換する。
&toeuc(\$str, $code, $os);
OPTION : errorcode => $str # 解析できないコードの置換
文字列を euc に変換する。
$code
が 'sjis' で、かつ $os
が 'win' または 'mac' ならば、
Win, Mac の機種依存文字を適切に処理する。
$code
が 'sjis' の場合、
機種依存文字以外の /[\xF0-\xFC][\x40-\x7E\x80-\xFC]/ にマッチする
文字を検出すると、その文字を opt::errorcode
で置換し
(デフォルトは ``\xA2\xAE'')、0 を返す。さもなければ 1 を返す。
従って、戻り値からこれらの文字が含まれていたか
(変換が正常に終了したか)を判別することができる。
DBIPgSystem, Jcode
Copyright (C) 2002 The Nagoya University Consumers' Co-operative Association
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the following URL for more details: http://www.gnu.org/licenses/gpl.txt
Written by Kenji Nakahira <nakahira@coop.nagoya-u.ac.jp>