ライブラリ
クラス
-
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)
- InvalidByteSequenceError (12)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) - NKF (12)
- String (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)
検索結果
先頭5件
-
String
# encode(**options) -> String (21227.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...ーディングを意味します。さもな
くば self のエンコーディングが使われます。
無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定さ......param option 変換オプションをキーワード引数で与えます。
@return 変換された文字列
変換オプション
: :invalid => nil
変換元のエンコーディングにおいて不正なバイトがあった場合に、例外 Encoding::InvalidByteSequen......ne => true
LF 改行を CRLF 改行に置き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encoding::UTF_8)... -
String
# encode(encoding , **options) -> String (21227.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...ーディングを意味します。さもな
くば self のエンコーディングが使われます。
無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定さ......param option 変換オプションをキーワード引数で与えます。
@return 変換された文字列
変換オプション
: :invalid => nil
変換元のエンコーディングにおいて不正なバイトがあった場合に、例外 Encoding::InvalidByteSequen......ne => true
LF 改行を CRLF 改行に置き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encoding::UTF_8)... -
String
# encode(encoding , from _ encoding , **options) -> String (21227.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...ーディングを意味します。さもな
くば self のエンコーディングが使われます。
無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定さ......param option 変換オプションをキーワード引数で与えます。
@return 変換された文字列
変換オプション
: :invalid => nil
変換元のエンコーディングにおいて不正なバイトがあった場合に、例外 Encoding::InvalidByteSequen......ne => true
LF 改行を CRLF 改行に置き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encoding::UTF_8)... -
URI
. encode(str , unsafe = URI :: UNSAFE) -> String (18313.0) -
URI 文字列をエンコードした文字列を返します。
...エンコードした文字列を返します。
このメソッドは obsolete です。
代わりに
ERB::Util.#url_encode,
CGI.escape,
URI.encode_www_form_component,
WEBrick::HTTPUtils.#escape_form,
WEBrick::HTTPUtils.#escape
などの使用を検討してください。
詳細は 29293 から......ドを参照してください。
例:
require 'uri'
p URI.escape('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 (15200.0) -
@todo
...@todo... -
RSS
:: ContentModel # content _ encoded= (15200.0) -
@todo
...@todo... -
Base64
. # strict _ encode64(bin) -> String (12301.0) -
与えられたデータを Base64 エンコードした文字列を返します。
与えられたデータを Base64 エンコードした文字列を返します。
このメソッドは 4648 に対応しています。
改行コードを追加することはありません。
@param bin Base64 エンコードするデータを指定します。 -
URI
. encode _ www _ form _ component(str , enc=nil) -> String (12219.0) -
文字列を URL-encoded form data の1コンポーネント としてエンコードした文字列を返します。
...文字列を URL-encoded form data の1コンポーネント
としてエンコードした文字列を返します。
通常は URI.encode_www_form を使うほうがよいでしょう。
このメソッドでは *, -, ., 0-9, A-Z, _, a-z, は変換せず、
空白は + に変換し、その他......は %XX に、変換します。
このメソッドは
https://www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data
にもとづいて実装されています。
//emlist[][ruby]{
require 'uri'
p URI.encode_www_form_component('Ruby リファレンスマニュアル')
# => "Ruby+%E......%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... -
Net
:: IMAP . encode _ utf7(str) -> String (12207.0) -
UTF-8 の文字列を modified UTF-7 の文字列に変換します。
...UTF-8 の文字列を modified UTF-7 の文字列に変換します。
modified UTF-7 は IMAP のメールボックス名に使われるエンコーディングで、
UTF-7 を修正したものです。
詳しくは Net::IMAP.encode_utf7 を見てください。
@param str 変換対象の UTF-8......でエンコードされた文字列
@see Net::IMAP.decode_utf7...