別のキーワード
ライブラリ
- ビルトイン (682)
- csv (12)
- kconv (12)
-
net
/ http (72) - open-uri (24)
- psych (36)
-
rexml
/ document (60) -
webrick
/ httprequest (12)
クラス
-
ARGF
. class (12) - Array (21)
- CSV (12)
- Encoding (60)
-
Encoding
:: Converter (192) -
Encoding
:: InvalidByteSequenceError (24) -
Encoding
:: UndefinedConversionError (12) - IO (24)
- Integer (24)
-
Psych
:: Stream (24) -
Psych
:: Visitors :: YAMLTree (12) -
REXML
:: Document (36) -
REXML
:: Instruction (24) - String (283)
- Time (42)
-
WEBrick
:: HTTPRequest (12)
モジュール
-
Net
:: HTTPHeader (72) -
OpenURI
:: Meta (24)
キーワード
- << (12)
-
append
_ as _ bytes (1) - asctime (12)
- b (12)
- casecmp (12)
- chr (24)
- chunked? (12)
- concat (21)
- content (12)
-
content
_ encoding (12) - convert (12)
- convpath (12)
- ctime (12)
-
destination
_ encoding (12) - each (12)
-
each
_ capitalized _ name (12) -
each
_ header (12) -
each
_ key (12) -
each
_ name (12) - encode (36)
- encode! (24)
-
error
_ bytes (12) -
error
_ char (12) -
external
_ encoding (12) - finish (12)
-
force
_ encoding (12) -
incomplete
_ input? (12) -
insert
_ output (12) - inspect (30)
-
internal
_ encoding (24) - iseuc (12)
-
last
_ error (12) - name (12)
- names (12)
- pack (21)
-
primitive
_ convert (48) -
primitive
_ errinfo (12) - putback (24)
- query (12)
- replacement (12)
- replacement= (12)
- replicate (12)
- scrub (36)
- scrub! (36)
-
source
_ encoding (12) -
stand
_ alone? (12) - start (36)
- target (12)
-
to
_ s (24) -
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - unpack (12)
-
valid
_ encoding? (12) - version (12)
検索結果
先頭5件
-
String
# scrub(repl) -> String (9243.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えた新しい文字列を返します。
...ます。
@param repl 不正なバイト列を置き換える文字列を指定します。省略した場合
は self の文字エンコーディングが Encoding::UTF_16BE,
Encoding::UTF_16LE, Encoding::UTF_32BE,
Encoding::UTF_32LE, Encoding::UTF_8 のいず......ブ
ロックの戻り値で置き換えられます。
//emlist[例][ruby]{
"abc\u3042\x81".scrub # => "abc\u3042\uFFFD"
"abc\u3042\x81".scrub("*") # => "abc\u3042*"
"abc\u3042\xE3\x80".scrub{|bytes| '<'+bytes.unpack('H*')[0]+'>' } # => "abc\u3042<e380>"
//}
@see String#scrub!... -
String
# concat(other) -> self (9232.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...other を破壊的に連結します。
other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
self を返します。
@param other 文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "str......ingXXX"
str << "YYY"
p str # => "stringXXXYYY"
str << 65 # 文字AのASCIIコード
p str # => "stringXXXYYYA"
//}... -
String
# unicode _ normalized?(form = :nfc) -> bool (9231.0) -
self が引数 form で指定された正規化形式で Unicode 正規化された文字列か どうかを返します。
...orm で指定された正規化形式で Unicode 正規化された文字列か
どうかを返します。
@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。
@raise Encoding::CompatibilityError......生します。
//emlist[例][ruby]{
"a\u0300".unicode_normalized? # => false
"a\u0300".unicode_normalized?(:nfd) # => true
"\u00E0".unicode_normalized? # => true
"\u00E0".unicode_normalized?(:nfd) # => false
"\xE0".force_encoding('ISO-8859-1').unicode_normalized?......# => Encoding::CompatibilityError raised
//}
@see String#unicode_normalize, String#unicode_normalize!... -
Time
# asctime -> String (9231.0) -
時刻を asctime(3) の形式の文字列に変換します。た だし、末尾の改行文字 "\n" は含まれません。
...を asctime(3) の形式の文字列に変換します。た
だし、末尾の改行文字 "\n" は含まれません。
戻り値の文字エンコーディングは Encoding::US_ASCII です。
//emlist[][ruby]{
p Time.local(2000).asctime # => "Sat Jan 1 00:00:00 2000"
p Time.local(......2000).asctime.encoding # => #<Encoding:US-ASCII>
p Time.local(2000).ctime # => "Sat Jan 1 00:00:00 2000"
//}... -
Time
# ctime -> String (9231.0) -
時刻を asctime(3) の形式の文字列に変換します。た だし、末尾の改行文字 "\n" は含まれません。
...を asctime(3) の形式の文字列に変換します。た
だし、末尾の改行文字 "\n" は含まれません。
戻り値の文字エンコーディングは Encoding::US_ASCII です。
//emlist[][ruby]{
p Time.local(2000).asctime # => "Sat Jan 1 00:00:00 2000"
p Time.local(......2000).asctime.encoding # => #<Encoding:US-ASCII>
p Time.local(2000).ctime # => "Sat Jan 1 00:00:00 2000"
//}... -
String
# concat(other) -> self (9229.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...other を破壊的に連結します。
other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
self を返します。
@param other 文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "str......ingXXX"
str << "YYY"
p str # => "stringXXXYYY"
str << 65 # 文字AのASCIIコード
p str # => "stringXXXYYYA"
//}... -
Encoding
:: Converter # finish -> String (9225.0) -
変換処理を終了し、結果文字列の末尾を返します。 変換元の文字列の末尾がバイト列の途中で終わっていた場合、保持しているバイト列全てを返します。
...ます。
@return 変換結果の末尾
@raise Encoding::InvalidByteSequenceError 変換元のエンコーディングにお
いて不正なバイト列があった場合に発生します。
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
p ec.convert("\u3042") #... -
Encoding
:: UndefinedConversionError # error _ char -> String (9225.0) -
エラーを発生させた1文字を文字列で返します。
...エラーを発生させた1文字を文字列で返します。
//emlist[例][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
begin
ec.convert("\u{a0}")
rescue Encoding::UndefinedConversionError
puts $!.error_char.dump #=> "\u{a0}"
end
//}... -
String
# concat(*arguments) -> self (9222.0) -
self に複数の文字列を破壊的に連結します。
...は Integer#chr の結果に相当する文字を末尾に追加します。追加する文字のエンコーディングは self.encoding です。
self を返します。
@param arguments 複数の文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "foo"
str.concat
p str # =>......"foo"
str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"
str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}......"foo"
str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"
str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}
@see String#append_as_bytes... -
Encoding
# name -> String (9219.0) -
エンコーディングの名前を返します。
...エンコーディングの名前を返します。
//emlist[例][ruby]{
Encoding::UTF_8.name #=> "UTF-8"
//}... -
Encoding
# names -> String (9219.0) -
エンコーディングの名前とエイリアス名の配列を返します。
...エンコーディングの名前とエイリアス名の配列を返します。
//emlist[例][ruby]{
Encoding::UTF_8.names #=> ["UTF-8", "CP65001"]
//}...