Unicode::Precis::Preparation~[ja] - RFC 7564 PRECISフレームワーク - 準備
use Unicode::Precis::Preparation qw(prepare IdentifierClass); $result = prepare($string, IdentifierClass); %result = prepare($string, IdentifierClass);
Unicode::Precis::Preparationは、PRECIS フレームワークに従ってユニコード文字列またはUTF-8のバイト文字列の準備を行う。
なお当ドキュメントでは、「UTF-8」という語を本来の意味で用いる。
文字列が指定した文字列クラスに適合するか検査する。
Parameters:
検査する文字列。ユニコード文字列かバイト文字列。
バイト文字列は、ユニコードへアップグレードされることなく UTF-8列として扱われることに注意。
ValidUTF8 (初期値)、FreeFormClass (RFC 7564参照)、IdentifierClass (同) のいずれか。
ValidUTF8
FreeFormClass
IdentifierClass
ユニコードの版を与えると、それに従ってレパートリを制限する。 初期状態では、当モジュールを使うPerl が対応しているユニコードの版のレパートリが使われる。
Returns:
スカラコンテキストでは、 指定した文字列クラスに適合すれば真値。そうでなければ偽値。
配列コンテキストでは、 次のキーを持つ対によるリストで結果の詳細を返す。
result
"Constants"で述べる特性値のいずれか。
offset
検査が失敗したときは、文字列の先頭からのオフセット。 成功したときは、文字列の長さ。
オフセットや長さは、 バイト文字列ではバイト数、ユニコード文字列では文字数で数える。
length
検査が失敗したときの、認められない文字の長さ。 長さは、バイト文字列では1から4、ユニコード文字列では常に1、 不正な列では未定義となる。
1
4
ord
lengthがある場合、文字のユニコードスカラ値。
文字列クラス。ValidUTF8は当モジュールによる拡張である。
結果を示す特性値。PVALIDは成功を意味する。
PVALID
初期状態ではなにもエクスポートしない。 :all タグで prepare()および定数をエクスポートする。
:all
prepare()はEBCDICプラットフォームでのユニコード文字列を検査できない。
Unicode::Precis - coming late.
RFC 7564 PRECIS Framework: Preparation, Enforcement, and Comparison of Internationalized Strings in Application Protocols. https://tools.ietf.org/html/rfc7564.
Hatuka*nezumi - IKEDA Soji, <hatuka@nezumi.nu>
Copyright (C) 2015 by Hatuka*nezumi - IKEDA Soji
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. For more details, see the full text of the licenses at <http://dev.perl.org/licenses/>.
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.
To install Unicode::Precis::Preparation, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Unicode::Precis::Preparation
CPAN shell
perl -MCPAN -e shell install Unicode::Precis::Preparation
For more information on module installation, please visit the detailed CPAN module installation guide.