るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.042秒)
トップページ > クエリ:String[x] > クエリ:Encoding[x] > 種類:モジュール関数[x]

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub

ライブラリ

モジュール

キーワード

検索結果

Kconv.#tolocale(str) -> String (126.0)

文字列 str のエンコーディングをロケールエンコーディングに変換して返します。

... Encoding.locale_charmap を見てください。

このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 String#encode
を使ってください。

Kconv.kconv(str, Encoding.loc...
...ale_charmap)と同じです。

@param str 変換元の文字列
@see String#tolocale...

Base64.#urlsafe_decode64(str) -> String (108.0)

与えられた文字列を Base64 デコードしたデータを返します。

...与えられた文字列を Base64 デコードしたデータを返します。

このメソッドは 4648 の "Base 64 Encoding with URL and Filename Safe Alphabet" に対応しています。
"+" を "-" に "/" を "_" に置き換えます。

@param str Base64 デコードする文字列を...

Base64.#urlsafe_encode64(bin, padding: true) -> String (108.0)

与えられたデータを Base64 エンコードした文字列を返します。

...与えられたデータを Base64 エンコードした文字列を返します。

このメソッドは 4648 の "Base 64 Encoding with URL and Filename Safe Alphabet" に対応しています。
"+" を "-" に "/" を "_" に置き換えます。

デフォルトでは戻り値は = による...

Kconv.#isjis(str) -> bool (19.0)

文字列 str が ISO-2022-JP なバイト列として正当であるかどうかを判定します。

...r 判定対象の文字列
@see String#isjis

//emlist[例][ruby]{
require 'kconv'

euc_str = "\
\xa5\xaa\xa5\xd6\xa5\xb8\xa5\xa7\xa5\xaf\xa5\xc8\xbb\xd8\xb8\xfe\
\xa5\xd7\xa5\xed\xa5\xb0\xa5\xe9\xa5\xdf\xa5\xf3\xa5\xb0\xb8\xc0\xb8\xec\
\x52\x75\x62\x79".force_encoding('EUC-JP')

jis_str = "\
\x1b\x...
...24\x42\x25\x2a\x25\x56\x25\x38\x25\x27\x25\x2f\x25\x48\x3b\x58\x38\x7e\
\x25\x57\x25\x6d\x25\x30\x25\x69\x25\x5f\x25\x73\x25\x30\x38\x40\x38\x6c\x1b\x28\x42\
\x52\x75\x62\x79".force_encoding('ISO-2022-JP')

euc_str.isjis # => false
jis_str.isjis # => true
//}...