種類
- インスタンスメソッド (168)
- 特異メソッド (127)
- 定数 (60)
- クラス (12)
- 文書 (12)
モジュール
- URI (24)
キーワード
- CP65001 (12)
- String (12)
-
UTF8
_ MAC (12) -
UTF
_ 8 _ HFS (12) -
UTF
_ 8 _ MAC (12) -
ascii
_ compatible? (12) - chr (12)
- compatible? (12)
-
decode
_ www _ form (12) -
decode
_ www _ form _ component (12) - dummy? (12)
- encode (36)
- encode! (24)
-
force
_ encoding (12) - inspect (12)
- name (12)
- names (12)
- new (43)
- open (48)
- replicate (12)
-
to
_ s (12) - リテラル (12)
検索結果
先頭5件
-
Encoding
:: UTF _ 8 -> Encoding (18201.0) -
UTF-8。Unicode や ISO 10646 を ASCII 互換な形で符号化するための方式です。
...UTF-8。Unicode や ISO 10646 を ASCII 互換な形で符号化するための方式です。
BOM を含みません。
@see https://tools.ietf.org/html/rfc3629... -
URI
. decode _ www _ form(str , enc=Encoding :: UTF _ 8) -> [[String , String]] (12301.0) -
文字列から URL-encoded form data をデコードします。
...文字列から URL-encoded form data をデコードします。
application/x-www-form-urlencoded 形式のデータをデコードし、
[key, value] という形の配列の配列を返します。
enc で指定したエンコーディングの文字列が URL エンコードされたもの......ドは
https://url.spec.whatwg.org/#concept-urlencoded-parser
にもとづいて実装されています。
そのため「&」区切りのみに対応していて、「;」区切りには対応していません。
require 'uri'
ary = URI.decode_www_form("a=1&a=2&b=3")
p ary......y.assoc('b').last #=> '3'
p Hash[ary] #=> {"a"=>"2", "b"=>"3"}
@param str デコード対象の文字列
@param enc エンコーディング
@raise ArgumentError str のフォーマットが不正である場合に発生します
@see URI.decode_www_form_component, URI.encode_www_form... -
URI
. decode _ www _ form _ component(str , enc=Encoding :: UTF _ 8) -> String (12301.0) -
URL-encoded form data の文字列の各コンポーネント をデコードした文字列を返します。
...URL-encoded form data の文字列の各コンポーネント
をデコードした文字列を返します。
通常は URI.decode_www_form を使うほうがよいでしょう。
"+" という文字は空白文字にデコードします。
enc で指定したエンコーディングの文字......ncoded-form-data
にもとづいて実装されています。
//emlist[][ruby]{
require 'uri'
enc = URI.encode_www_form_component('Ruby リファレンスマニュアル')
# => "Ruby+%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9%E3%83%9E%E3%83%8B%E3%83%A5%E3%82%A2%E3%83%AB"
p URI.decode_......www_form_component(enc)
# => "Ruby リファレンスマニュアル"
//}
@param str デコード対象の文字列
@param enc エンコーディング
@raise ArgumentError str のフォーマットが不正である場合に発生します
@see URI.encode_www_form_component, URI.decode_www_form... -
Encoding
:: UTF _ 8 _ HFS -> Encoding (6218.0) -
UTF8-MAC、アップルによって修正された Normalization Form D(分解済み)という形式のUTF-8です。
...UTF8-MAC、アップルによって修正された Normalization Form D(分解済み)という形式のUTF-8です。
@see http://developer.apple.com/jp/technotes/tn1150.html,
http://developer.apple.com/jp/technotes/tn2078.html... -
Encoding
:: UTF _ 8 _ MAC -> Encoding (6218.0) -
UTF8-MAC、アップルによって修正された Normalization Form D(分解済み)という形式のUTF-8です。
...UTF8-MAC、アップルによって修正された Normalization Form D(分解済み)という形式のUTF-8です。
@see http://developer.apple.com/jp/technotes/tn1150.html,
http://developer.apple.com/jp/technotes/tn2078.html... -
String
# force _ encoding(encoding) -> self (6206.0) -
文字列の持つエンコーディング情報を指定された encoding に変えます。
...情報を指定された encoding に変えます。
このとき実際のエンコーディングは変換されず、検査もされません。
Array#pack などで得られたバイト列のエンコーディングを指定する時に使います。
@param encoding 変更するエンコー......す文字列か Encoding オブジェクトを指定します。
//emlist[例][ruby]{
s = [164, 164, 164, 237, 164, 207].pack("C*")
p s.encoding #=> ASCII-8BIT
p s.force_encoding("EUC-JP") #=> "いろは"
p s.force_encoding(Encoding::EUC_JP)......#=> "いろは"
u = [12411, 12408, 12392].pack("U*")
u.force_encoding("UTF-8") #=> "ほへと"
u.force_encoding(Encoding::UTF_8) #=> "ほへと"
//}... -
Encoding
# dummy? -> bool (6106.0) -
自身がダミーエンコーディングである場合に true を返します。 そうでない場合に false を返します。
...グに指定できます。また
Ruby はサポートしていないが拡張ライブラリがサポートしているエンコーディングを扱う場合にも
用います。
//emlist[例][ruby]{
Encoding::ISO_2022_JP.dummy? #=> true
Encoding::UTF_8.dummy? #=> false
//}... -
String
# encode!(encoding , from _ encoding , options = nil) -> self (6106.0) -
self を指定したエンコーディングに変換し、自身を置き換えます。引数を2つ 与えた場合、第二引数は変換元のエンコーディングを意味します。さもなくば self のエンコーディングが使われます。変換後の self を返します。
...なくても self を返します。
@param encoding 変換先のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@ret......urn 変換後のself
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode!("EUC-JP")
s.encode!(Encoding::UTF_8)
//}
@see String#encode... -
String
# encode!(encoding , options = nil) -> self (6106.0) -
self を指定したエンコーディングに変換し、自身を置き換えます。引数を2つ 与えた場合、第二引数は変換元のエンコーディングを意味します。さもなくば self のエンコーディングが使われます。変換後の self を返します。
...なくても self を返します。
@param encoding 変換先のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@ret......urn 変換後のself
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode!("EUC-JP")
s.encode!(Encoding::UTF_8)
//}
@see String#encode...