| « 2007年5月21日 | メイン | 2007年5月23日 » | 
このブログを書く四元輝博とジョシュア清水が経営する旅行代理店スカイメリカ
ジョシュア清水 自らが操縦する、日本語でのガイドと会話を楽しみながらハワイ島を巡るセスナの旅
このブログを書く四元輝博と共にスカイメリカを経営するハワイ島在住の日本人パイロット、ジョシュア清水のブログ
スカイメリカの共同経営者、シリコンバレー在住の四元輝博によるIT情報・ベンチャー起業に関するブログ
四元輝博によるに 「組み込みJava による M2Mソリューション」に関する調査レポート・サイト
: 日付別 アーカイブ :
2007年5月22日
% idn libidn 1.2 Copyright 2002, 2003, 2004, 2005, 2006, 2007 Simon Josefsson. GNU Libidn comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Libidn under the terms of the GNU Lesser General Public License. For more information about these matters, see the file named COPYING.LIB. Type each input string on a line by itself, terminated by a newline character. abc abc idn: tld_check_4z: Missing input %と このように表示される。 これで、libidn のバージョンが 1.2 であることが確認できる。 その後、入力を待っているので、 ここでは試しに「abc」+「エンターキー」と打ってみると、 そのまま 「abc」が表示された。 次の行で 何も入力せず「エンターキー」と打ってみると、 「idn: tld_check_4z: Missing input」というエラー・メッセージを表示して終了してしまった。
% idn -h
libidn 1.2
Command line interface to the internationalized domain name library.
All strings are expected to be encoded in the preferred charset used
by your locale.  Use `--debug' to find out what this charset is.  You
can override the charset used by setting environment variable CHARSET.
To process a string that starts with `-', for example `-foo', use `--'
to signal the end of parameters, as in `idn --quiet -a -- -foo'.
Usage: libidn [OPTIONS]... [STRINGS]...
  -h, --help               Print help and exit
  -V, --version            Print version and exit
  -s, --stringprep         Prepare string according to nameprep profile
  -d, --punycode-decode    Decode Punycode
  -e, --punycode-encode    Encode Punycode
  -a, --idna-to-ascii      Convert to ACE according to IDNA (default)
  -u, --idna-to-unicode    Convert from ACE according to IDNA
      --allow-unassigned   Toggle IDNA AllowUnassigned flag  (default=off)
      --usestd3asciirules  Toggle IDNA UseSTD3ASCIIRules flag  (default=off)
  -t, --tld                Check string for TLD specific rules
                             Only for --idna-to-ascii and --idna-to-unicode
                             (default=on)
  -p, --profile=STRING     Use specified stringprep profile instead
                             Valid stringprep profiles are `Nameprep', `iSCSI',
                             `Nodeprep', `Resourceprep', `trace', and
                             `SASLprep'.
      --debug              Print debugging information  (default=off)
      --quiet              Silent operation  (default=off)
%
と このようにヘルプが表示される。
ここに、locale により適切な charset が設定されている必要がある、
と書いてある。
また、現在の charset は --debug オプションをつけるとわかるようだ。
% idn --debug --quiet "" Charset `US-ASCII'. idn: tld_check_4z: Missing inputこでれ、Charset が「 US-ASCII 」であることがわかった。
% setenv CHARSET UTF-8 % printenv | grep CHARSET CHARSET=UTF-8 % idn --debug --quiet "" Charset `UTF-8'. idn: tld_check_4z: Missing input %として Charset を「 UTF-8 」に変更して それを idn --debug コマンドで確認している。
% idn --quiet -a 日本語ドメイン名example.jp xn--example-6q4fyliikhk162btq3b2zd4y2o.jp %それから、「-u」が「Convert from ACE according to IDNA」とあるので、
% idn --quiet -u xn--example-6q4fyliikhk162btq3b2zd4y2o.jp 日本語ドメイン名example.jp %となり、どちらの方向にも変換が正しく行われていることが確認できる。
カテゴリー: DNS・URL・URI 22:00 | コメント (0) | トラックバック (0)