ライブラリ
- ビルトイン (43)
-
net
/ imap (11) - open-uri (11)
-
rexml
/ document (22) -
webrick
/ httprequest (11)
クラス
-
Net
:: IMAP :: BodyTypeText (11) -
REXML
:: Instruction (22) - String (43)
-
WEBrick
:: HTTPRequest (11)
モジュール
-
OpenURI
:: Meta (11)
キーワード
- content (11)
- encode (33)
- query (11)
- target (11)
-
unicode
_ normalize! (10)
検索結果
先頭5件
-
Net
:: IMAP :: BodyTypeText # encoding -> String (21250.0) -
Content-Transfer-Encoding の値を文字列で返します。
...Content-Transfer-Encoding の値を文字列で返します。
@see 2045... -
String
# encode(encoding , from _ encoding , **options) -> String (428.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
@param encoding 変換先のエ......ンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換オプションをキーワード引数で与えま......列
変換オプション
: :invalid => nil
変換元のエンコーディングにおいて不正なバイトがあった場合に、例外 Encoding::InvalidByteSequenceError を投げます。(デフォルト)
: :invalid => :replace
変換元のエンコーディングにおいて不正な... -
String
# encode(encoding , **options) -> String (328.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
@param encoding 変換先のエ......ンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換オプションをキーワード引数で与えま......列
変換オプション
: :invalid => nil
変換元のエンコーディングにおいて不正なバイトがあった場合に、例外 Encoding::InvalidByteSequenceError を投げます。(デフォルト)
: :invalid => :replace
変換元のエンコーディングにおいて不正な... -
String
# encode(**options) -> String (228.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
@param encoding 変換先のエ......ンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換オプションをキーワード引数で与えま......列
変換オプション
: :invalid => nil
変換元のエンコーディングにおいて不正なバイトがあった場合に、例外 Encoding::InvalidByteSequenceError を投げます。(デフォルト)
: :invalid => :replace
変換元のエンコーディングにおいて不正な... -
REXML
:: Instruction # content -> String | nil (149.0) -
XML 処理命令の内容を返します。
...= REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<?foobar?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "type=\"text/css\" href=\"style.css\""
doc[4].target # => "f... -
REXML
:: Instruction # target -> String (149.0) -
XML 処理命令のターゲットを返します。
...quire 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "type=\"text/css\" href=\"style.css\""
//}... -
WEBrick
:: HTTPRequest # query -> Hash (143.0) -
リクエストのクエリーあるいはクライアントがフォームへ入力した値を表すハッシュを返します。
...ュを返します。
ハッシュのキーも値も unescape されています。ただし multipart/form-data なフォームデータの場合には
ユーザが content-transfer-encoding ヘッダを見て適切に処理する必要があります。
ハッシュの値は正確には文字列......ではなく String クラスのサブクラスである WEBrick::HTTPUtils::FormData
クラスのインスタンスです。
multipart/form-data なフォームデータであってもサイズの制限なく、通常のフォームデータと
同じように扱われることに注意してく......巨大な文字列が
生成されてしまいます。
例:
h = req.query
p h['q'] #=> "ruby rails session"
p h['upfile']['content-type'] #=> "plain/text"
p h['upfile'].filename #=> "my_file.txt"
p h['upfile'] #=> "hoge hoge hoge"... -
OpenURI
:: Meta # meta -> Hash (137.0) -
ヘッダを収録したハッシュを返します。
...][ruby]{
require 'open-uri'
open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "transfer-encoding"=>"chunked"}
}
//}......ruby]{
require 'open-uri'
URI.open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "transfer-encoding"=>"chunked"}
}
//}... -
String
# unicode _ normalize!(form = :nfc) -> self (137.0) -
self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列に置き換えます。
...。
@raise Encoding::CompatibilityError self が Unicode 文字列ではない場合
に発生します。
//emlist[例][ruby]{
text = "a\u0300"
text.unicode_normalize!(:nfc)
text == "\u00E0" # => true
text.unicode_normalize!(:nfd)
text == "a\u0300"...