ライブラリ
クラス
-
ARGF
. class (36) - Encoding (12)
-
Encoding
:: Converter (36) - IO (84)
-
Net
:: IMAP (24) - String (160)
- StringScanner (60)
- Symbol (21)
モジュール
- Base64 (36)
-
CGI
:: HtmlExtension (24) - Digest (12)
-
ERB
:: Util (24) -
JSON
:: Generator :: GeneratorMethods :: String (12) - Kconv (12)
-
RSS
:: ContentModel (24) - URI (62)
キーワード
- CompatibilityError (12)
- Converter (12)
- ConverterNotFoundError (12)
- EncodeError (12)
- InvalidByteSequenceError (12)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) - NKF (12)
- String (12)
- UndefinedConversionError (12)
- base64 (12)
- casecmp (24)
- casecmp? (18)
-
content
_ encoded (12) -
content
_ encoded= (12) -
decode
_ utf7 (12) -
decode
_ www _ form (12) -
decode
_ www _ form _ component (12) -
default
_ internal (12) -
each
_ codepoint (24) - encode! (24)
- encode64 (12)
-
encode
_ utf7 (12) -
encode
_ www _ form (12) -
encode
_ www _ form _ component (12) - encoding (12)
- escape (7)
-
for
_ fd (12) - form (24)
-
get
_ byte (12) - getbyte (12)
- getch (12)
- hexencode (12)
- match? (12)
-
matched
_ size (12) - new (79)
- open (24)
-
ruby 1
. 8 . 3 feature (12) -
set
_ encoding (72) -
strict
_ encode64 (12) -
to
_ json _ raw _ object (12) - tolocale (24)
- u (12)
-
url
_ encode (12) -
urlsafe
_ encode64 (12) - 多言語化 (12)
- 正規表現 (12)
検索結果
先頭5件
-
String
# encode(encoding , from _ encoding , **options) -> String (24427.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...self を指定したエンコーディングに変換した文字列を作成して返します。引数
を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな
くば self のエンコーディングが使われます。
無引数の場合は、En......coding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
@param encoding 変換先のエンコーディングを表......crlf_newline => true
LF 改行を CRLF 改行に置き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encodin... -
String
# encode(encoding , **options) -> String (24327.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...self を指定したエンコーディングに変換した文字列を作成して返します。引数
を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな
くば self のエンコーディングが使われます。
無引数の場合は、En......coding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
@param encoding 変換先のエンコーディングを表......crlf_newline => true
LF 改行を CRLF 改行に置き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encodin... -
String
# encode(**options) -> String (24227.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...self を指定したエンコーディングに変換した文字列を作成して返します。引数
を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな
くば self のエンコーディングが使われます。
無引数の場合は、En......coding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
@param encoding 変換先のエンコーディングを表......crlf_newline => true
LF 改行を CRLF 改行に置き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encodin... -
URI
. encode(str , unsafe = URI :: UNSAFE) -> String (24219.0) -
URI 文字列をエンコードした文字列を返します。
...lete です。
代わりに
ERB::Util.#url_encode,
CGI.escape,
URI.encode_www_form_component,
WEBrick::HTTPUtils.#escape_form,
WEBrick::HTTPUtils.#escape
などの使用を検討してください。
詳細は 29293 からのスレッドを参照してください。
例:
require 'uri'
p URI.e......scape('http://images.google.co.jp/images?q=モナリザ&ie=EUC-JP')
#=> "http://images.google.co.jp/images?q=%A5%E2%A5%CA%A5%EA%A5%B6&ie=EUC-JP"
@param str URI を文字列として与えます。
@param unsafe URI として指定できない文字を正規表現か文字列で指定します... -
RSS
:: ContentModel # content _ encoded (21300.0) -
@todo
@todo -
RSS
:: ContentModel # content _ encoded= (21300.0) -
@todo
@todo -
URI
. encode _ www _ form _ component(str , enc=nil) -> String (18491.0) -
文字列を URL-encoded form data の1コンポーネント としてエンコードした文字列を返します。
...文字列を URL-encoded form data の1コンポーネント
としてエンコードした文字列を返します。
通常は URI.encode_www_form を使うほうがよいでしょう。
このメソッドでは *, -, ., 0-9, A-Z, _, a-z, は変換せず、
空白は + に変換し、その他......rms.html#url-encoded-form-data
にもとづいて実装されています。
//emlist[][ruby]{
require 'uri'
p 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"
//}......@param str エンコードする文字列
@param enc 指定された場合、パーセントエンコーディングする前に、strをこのエンコーディングに変換
@see URI.decode_www_form_component, URI.encode_www_form... -
Base64
. # urlsafe _ encode64(bin , padding: true) -> String (15213.0) -
与えられたデータを Base64 エンコードした文字列を返します。
...与えられたデータを Base64 エンコードした文字列を返します。
このメソッドは 4648 の "Base 64 Encoding with URL and Filename Safe Alphabet" に対応しています。
"+" を "-" に "/" を "_" に置き換えます。
デフォルトでは戻り値は = による......に false を指定してください。
@param bin Base64 エンコードするデータを指定します。
@param padding false を指定した場合、 = によるパディングが行われなくなります。
//emlist[例][ruby]{
require 'base64'
p Base64.urlsafe_encode64('hoge')
# => "aG......9nZQ=="
p Base64.urlsafe_encode64('hoge', padding: false)
# => "aG9nZQ"
//}... -
Base64
. # encode64(bin) -> String (15207.0) -
与えられたデータを Base64 エンコードした文字列を返します。
...ase64 エンコードした文字列を返します。
このメソッドは 2045 に対応しています。
エンコード後の文字で 60 文字ごとに改行を追加します。
@param bin Base64 エンコードするデータを指定します。
require 'base64'
Base64.encode6......4("Now is the time for all good coders\nto learn Ruby")
# => Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
# UnVieQ==...