310件ヒット
[201-300件を表示]
(0.080秒)
別のキーワード
種類
- インスタンスメソッド (157)
- 特異メソッド (72)
- モジュール関数 (48)
- 文書 (21)
- ライブラリ (12)
クラス
-
Net
:: HTTPResponse (12) - Refinement (4)
- Regexp (22)
- String (141)
- WIN32OLE (12)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Ruby用語集 (12)
- codepage (12)
- codepoints (24)
- compile (11)
-
decode
_ www _ form _ component (12) -
each
_ codepoint (24) - encode (43)
- encode! (24)
- encode64 (12)
-
encode
_ www _ form _ component (12) - escape (7)
- hexencode (12)
-
import
_ methods (4) - kconv (12)
- new (11)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) -
url
_ encode (12) -
urlsafe
_ encode64 (12)
検索結果
先頭5件
-
URI
. encode _ www _ form _ component(str , enc=nil) -> String (6338.0) -
文字列を URL-encoded form data の1コンポーネント としてエンコードした文字列を返します。
...文字列を URL-encoded form data の1コンポーネント
としてエンコードした文字列を返します。
通常は URI.encode_www_form を使うほうがよいでしょう。
このメソッドでは *, -, ., 0-9, A-Z, _, a-z, は変換せず、
空白は + に変換し、その他......ttps://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+%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9%E3%8......3%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... -
URI
. encode(str , unsafe = URI :: UNSAFE) -> String (6316.0) -
URI 文字列をエンコードした文字列を返します。
...I 文字列をエンコードした文字列を返します。
このメソッドは obsolete です。
代わりに
ERB::Util.#url_encode,
CGI.escape,
URI.encode_www_form_component,
WEBrick::HTTPUtils.#escape_form,
WEBrick::HTTPUtils.#escape
などの使用を検討してください。
詳細は... -
Base64
. # encode64(bin) -> String (6314.0) -
与えられたデータを Base64 エンコードした文字列を返します。
...字ごとに改行を追加します。
@param bin Base64 エンコードするデータを指定します。
require 'base64'
Base64.encode64("Now is the time for all good coders\nto learn Ruby")
# => Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
# UnVieQ==... -
Base64
. # urlsafe _ encode64(bin , padding: true) -> String (6314.0) -
与えられたデータを Base64 エンコードした文字列を返します。
...データを指定します。
@param padding false を指定した場合、 = によるパディングが行われなくなります。
//emlist[例][ruby]{
require 'base64'
p Base64.urlsafe_encode64('hoge')
# => "aG9nZQ=="
p Base64.urlsafe_encode64('hoge', padding: false)
# => "aG9nZQ"
//}... -
WIN32OLE
. codepage -> Integer (6124.0) -
WIN32OLEがOLEオートメーションのインターフェイスに利用するコードページを 取得します。
...ージを
取得します。
OLEオートメーションに利用する文字列はUnicodeでエンコードします。
WIN32OLEはここで示されたコードページを利用してRubyのStringとUnicodeの相
互変換を行います。
ロード時の既定値はEncoding.default_internal......するコード
ページが見つからない場合は、WIN32OLE::CP_ACPを利用します。
@return WIN32OLEがオートメーション呼び出しの文字列変換に利用するコード
ページを返します。
WIN32OLE.codepage # => 932 (日本語Windowsの既定値)... -
ERB
:: Util . # url _ encode(s) -> String (3340.0) -
文字列 s を URLエンコードした文字列を返します。
...を返します(CGI.escapeとほぼ同じです)。
@param s URLエンコードを行う文字列
//emlist[例][ruby]{
require "erb"
include ERB::Util
puts url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
//}... -
URI
. escape(str , unsafe = URI :: UNSAFE) -> String (3216.0) -
URI 文字列をエンコードした文字列を返します。
...I 文字列をエンコードした文字列を返します。
このメソッドは obsolete です。
代わりに
ERB::Util.#url_encode,
CGI.escape,
URI.encode_www_form_component,
WEBrick::HTTPUtils.#escape_form,
WEBrick::HTTPUtils.#escape
などの使用を検討してください。
詳細は... -
Regexp
. compile(string , option = nil , code = nil) -> Regexp (368.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。
@param string 正規表現を文字列として与えま......して見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE の指定と同じになります。
@param code "n", "N" が与えられた時には、生成された正規表現のエンコーディングは ASCII-8BIT になります。
それ......の指定は警告を出力します。
@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。
//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"
t2 = Regexp.compile('
th... -
Regexp
. new(string , option = nil , code = nil) -> Regexp (368.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。
@param string 正規表現を文字列として与えま......して見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE の指定と同じになります。
@param code "n", "N" が与えられた時には、生成された正規表現のエンコーディングは ASCII-8BIT になります。
それ......の指定は警告を出力します。
@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。
//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"
t2 = Regexp.compile('
th... -
kconv (162.0)
-
日本語文字コードの変換を手軽に行うためのライブラリです。
...。
kconv を require すると String クラスに変換用のメソッドが定義されます。
Kconv にも同等のメソッドが定義されます。 Kconv には
エンコーディングを表す定数も定義されています。
1.9.1 以降では、Ruby の m17n 機能を用いてエ....../emlist[][ruby]{
require 'kconv'
newstring = Kconv.kconv(string, Kconv::JIS, Kconv::AUTO)
newstring = Kconv.tojis(string)
newstring = Kconv.toeuc(string)
newstring = Kconv.tosjis(string)
guessed_code = Kconv.guess(string)
//}
または
//emlist[][ruby]{
require 'kconv'
newstring = string.kconv(Kco......nv::JIS, Kconv::AUTO)
newstring = string.tojis
newstring = string.toeuc
newstring = string.tosjis
//}...