るりまサーチ

最速Rubyリファレンスマニュアル検索!
342件ヒット [201-300件を表示] (0.072秒)

別のキーワード

  1. string encode
  2. _builtin encode
  3. string encode!
  4. base64 encode64
  5. _builtin encode!

ライブラリ

クラス

キーワード

検索結果

<< < 1 2 3 4 > >>

IO#set_encoding(ext_enc) -> self (7.0)

IO のエンコーディングを設定します。

...で外部エンコーディングを内部エンコーディングに変換する際の
オプションを指定します。
詳しくは String#encode を参照してください。

@param enc_str エンコーディングを表す文字列を指定します。"A:B" のようにコロンで区切...

IO#set_encoding(ext_enc, int_enc, **opts) -> self (7.0)

IO のエンコーディングを設定します。

...で外部エンコーディングを内部エンコーディングに変換する際の
オプションを指定します。
詳しくは String#encode を参照してください。

@param enc_str エンコーディングを表す文字列を指定します。"A:B" のようにコロンで区切...

String#casecmp(other) -> -1 | 0 | 1 | nil (7.0)

String#<=> と同様に文字列の順序を比較しますが、 アルファベットの大文字小文字の違いを無視します。

...=> 0
"aBcDeF".casecmp("abcdefg") #=> -1
"abcdef".casecmp("ABCDEF") #=> 0
//}

nil は文字列のエンコーディングが非互換の時に返されます。

//emlist[][ruby]{
"\u{e4 f6 fc}".encode("ISO-8859-1").casecmp("\u{c4 d6 dc}") #=> nil
//}

@see String#<=>, Encoding.compatible?...
...#=> 0
"aBcDeF".casecmp("abcdefg") #=> -1
"abcdef".casecmp("ABCDEF") #=> 0
//}

nil は文字列のエンコーディングが非互換の時に返されます。

//emlist[][ruby]{
"\u{e4 f6 fc}".encode("ISO-8859-1").casecmp("\u{c4 d6 dc}") #=> nil
//}

@see String#<=>, Encoding.compatible?...

String#casecmp?(other) -> bool | nil (7.0)

大文字小文字の違いを無視し文字列を比較します。 文字列が一致する場合には true を返し、一致しない場合には false を返します。

...false
"abcdef".casecmp?("ABCDEF") #=> true
"\u{e4 f6 fc}".casecmp?("\u{c4 d6 dc}") #=> true
//}

nil は文字列のエンコーディングが非互換の時に返されます。

//emlist[][ruby]{
"\u{e4 f6 fc}".encode("ISO-8859-1").casecmp?("\u{c4 d6 dc}") #=> nil
//}

@see String#casecmp...

String#each_codepoint -> Enumerator (7.0)

文字列の各コードポイントに対して繰り返します。

...ます。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}

@see String#codepoints...

絞り込み条件を変える

String#each_codepoint {|codepoint| block } -> self (7.0)

文字列の各コードポイントに対して繰り返します。

...ます。

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}

@see String#codepoints...

String#encoding -> Encoding (7.0)

文字列のエンコーディング情報を表現した Encoding オブジェクトを返します。

...列のエンコーディング情報を表現した Encoding オブジェクトを返します。

//emlist[例][ruby]{
# encoding: utf-8
utf8_str = "test"
euc_str = utf8_str.encode("EUC-JP")
utf8_str.encoding # => #<Encoding:UTF-8>
euc_str.encoding # => #<Encoding:EUC-JP>
//}

@see Encoding...

String#tolocale -> String (7.0)

self のエンコーディングをロケールエンコーディングに変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。

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

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

@see Kconv.#tolocale...

StringScanner#get_byte -> String | nil (7.0)

1 バイトスキャンして文字列で返します。 スキャンポインタをその後ろに進めます。 スキャンポインタが文字列の末尾を指すなら nil を返します。

...StringScanner#get_byte を使ってください。

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

utf8 = "\u{308B 3073 3044}"
s = StringScanner.new(utf8.encode("EUC-JP"))
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xEB"
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xD3"
p s.get_byte...

StringScanner#getbyte -> String | nil (7.0)

1 バイトスキャンして文字列で返します。 スキャンポインタをその後ろに進めます。 スキャンポインタが文字列の末尾を指すなら nil を返します。

...StringScanner#get_byte を使ってください。

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

utf8 = "\u{308B 3073 3044}"
s = StringScanner.new(utf8.encode("EUC-JP"))
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xEB"
p s.get_byte #=> "\xA4"
p s.get_byte #=> "\xD3"
p s.get_byte...

絞り込み条件を変える

<< < 1 2 3 4 > >>