- Title
- si:www-url-encode
- Type
- Function
- Arguments
- www-url-encode INPUT-STRING-OR-STREAM &optional OUTPUT-STREAM LITERAL-CHARS
- Package
- system
- Section
- その他
- File
- builtin.l
RFC1738 に基づき文字列の URL エンコードを行います。
INPUT-STRING-OR-STREAM : 入力の文字列または入力ストリームを指定します。
OUTPUT-STREAM : 出力ストリームです。
t を指定した場合は標準出力へ出力します。
省略もしくは nil を指定すると戻り値になります。
LITERAL-CHARS : エンコードしない文字群を指定します。
t すべての文字をエンコードする
nil "-A-Za-z0-9$_.+!*'(|),"と同値
使用例:
; 標準では Shift_JIS としてエンコード
(si:www-url-encode "かめ")
=>"%82%A9%82%DF"
; EUC-JP としてエンコード
(si:www-url-encode (map-internal-to-euc "かめ"))
=>"%A4%AB%A4%E1"
; 変換しない文字群を明示する
(si:www-url-encode "www-url-encode" nil "0-9A-Za-z")
=>"www%2Durl%2Dencode"
補足:
RFC1738は現在RFC3986によって更新されています。
RFC3986で定義されている unreserved な文字の種類は "0-9A-Za-z---._~" です。
xyzzy 0.2.2.233 では builtin.l 中の引数の記述が間違っています。
0.2.2.234 で修正されました。
- Seealso
- si:www-url-decode