1016件ヒット
[201-300件を表示]
(0.132秒)
ライブラリ
- ビルトイン (571)
-
cgi
/ core (12) - csv (12)
-
irb
/ input-method (36) -
minitest
/ unit (1) -
net
/ http (72) -
net
/ imap (36) - open-uri (24)
- openssl (12)
- psych (72)
-
rexml
/ document (48) - ripper (12)
- rss (24)
- scanf (12)
- stringio (12)
-
webrick
/ httprequest (24) -
webrick
/ httpresponse (12)
クラス
-
ARGF
. class (24) - Array (21)
- CSV (12)
- Encoding (36)
-
Encoding
:: Converter (168) -
Encoding
:: InvalidByteSequenceError (24) - IO (54)
-
IRB
:: FileInputMethod (12) -
IRB
:: ReadlineInputMethod (12) -
IRB
:: StdioInputMethod (12) - Integer (24)
-
Net
:: IMAP :: BodyTypeBasic (12) -
Net
:: IMAP :: BodyTypeMessage (12) -
Net
:: IMAP :: BodyTypeText (12) -
OpenSSL
:: SSL :: SSLContext (12) -
Psych
:: Handler (12) -
Psych
:: Nodes :: Stream (24) -
Psych
:: Stream (24) -
Psych
:: Visitors :: YAMLTree (12) -
RDoc
:: Options (24) -
REXML
:: Document (24) -
REXML
:: Instruction (24) - Regexp (24)
- Ripper (12)
- String (166)
- StringIO (12)
- Time (42)
-
WEBrick
:: HTTPRequest (24) -
WEBrick
:: HTTPResponse (12)
モジュール
-
CGI
:: QueryExtension (12) -
MiniTest
:: Assertions (1) -
Net
:: HTTPHeader (72) -
OpenURI
:: Meta (24) -
RSS
:: RootElementMixin (24)
キーワード
- << (12)
-
accept
_ encoding (24) -
append
_ as _ bytes (1) -
ascii
_ compatible? (12) - asctime (12)
-
ca
_ file= (12) - casecmp (12)
- chr (24)
- chunked= (12)
- chunked? (12)
- concat (21)
- content (12)
-
content
_ encoding (12) - convpath (12)
- ctime (12)
- each (12)
-
each
_ capitalized _ name (12) -
each
_ header (12) -
each
_ key (12) -
each
_ name (12) - encode (36)
- encode! (24)
- encoding= (24)
-
error
_ bytes (12) -
external
_ encoding (12) - finish (12)
-
fixed
_ encoding? (12) -
force
_ encoding (12) -
incomplete
_ input? (12) -
insert
_ output (12) - inspect (42)
-
internal
_ encoding (12) -
last
_ error (12) -
mu
_ pp (1) -
output
_ encoding (12) -
output
_ encoding= (12) - pack (21)
-
primitive
_ convert (48) -
primitive
_ errinfo (12) - putback (24)
- query (12)
- replacement (12)
- replacement= (12)
- replicate (12)
- scanf (12)
- scrub (12)
- scrub! (12)
-
set
_ encoding (60) -
set
_ encoding _ by _ bom (6) - start (36)
-
start
_ stream (12) - target (12)
-
to
_ s (12) - unpack (12)
- write (24)
検索結果
先頭5件
-
RSS
:: RootElementMixin # output _ encoding= (12203.0) -
@todo
@todo -
Encoding
:: Converter # primitive _ errinfo -> Array (9225.0) -
直前の Encoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。
...直前の Encoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。
@return [result, enc1, enc2, error_bytes, readagain_bytes] という五要素の配列
result は直前の primitive_convert の戻り値です。
それ以外の四要素は......:invalid_byte_sequence か :incomplete_input か :undefined_conversion だった場合に意味を持ちます。
enc1 はエラーの発生した原始変換の変換元のエンコーディング、enc2 は変換先のエンコーディングです。
error_bytes はエラーの発生原因とな......
primitive_errinfo はもっぱら Encoding::Converter#primitive_convert と組み合わせて使います。Encoding::Converter#convert を用いている場合にも取得することはできますが、有用な使い方は難しいでしょう。
//emlist[][ruby]{
# \xff is invalid as EUC-JP.... -
Regexp
# fixed _ encoding? -> bool (9204.0) -
正規表現が任意の ASCII 互換エンコーディングとマッチ可能な時に false を返します。
...r = /a/
r.fixed_encoding? # => false
r.encoding # => #<Encoding:US-ASCII>
r =~ "\u{6666} a" # => 2
r =~ "\xa1\xa2 a".force_encoding("euc-jp") # => 2
r =~ "abc".force_encoding("euc-jp") #......_encoding? # => true
r.encoding # => #<Encoding:UTF-8>
r =~ "\u{6666} a" # => 2
begin
r =~ "\xa1\xa2".force_encoding("euc-jp")
rescue => e
e.class # => Encoding:......:CompatibilityError
end
r =~ "abc".force_encoding("euc-jp") # => 0
r = /\u{6666}/
r.fixed_encoding? # => true
r.encoding # => #<Encoding:UTF-8>
r =~ "\u{6666} a" # => 0
begin
r =~ "\xa1\xa... -
Encoding
:: InvalidByteSequenceError # incomplete _ input? -> bool (9155.0) -
エラー発生時に入力文字列が不足している場合に真を返します。
...ます。
//emlist[例][ruby]{
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
begin
ec.convert("abc\xA1z")
rescue Encoding::InvalidByteSequenceError
p $!
#=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "z" on EUC-JP>
p $!.incomplete_input? #=> false
end
begin
ec.co......nvert("abc\xA1")
ec.finish
rescue Encoding::InvalidByteSequenceError
p $! #=> #<Encoding::InvalidByteSequenceError: incomplete "\xA1" on EUC-JP>
p $!.incomplete_input? #=> true
end
//}... -
Encoding
:: Converter # insert _ output(string) -> nil (9149.0) -
変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
...されるべきです。
@param string 挿入する文字列
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec.primitive_convert(src, dst) #=> :undefined_conversion
puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER......t_output("<err>")
p ec.primitive_convert(src, dst) #=> :finished
puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is <err>.", ""]
ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
src = "\u{306F 3041 3068 2661 3002}" # U+2661 is not representable in iso-2022-jp
dst = ""
p ec.primit......ndefined_conversion
puts "[#{dst.dump}, #{src.dump}]" #=> ["\e$B$O$!$H".force_encoding("ISO-2022-JP"), "\xE3\ x80\x82"]
ec.insert_output "?" # state change required to output "?".
p ec.primitive_convert(src, dst) #=> :finished
puts "[#{dst.dump}, #{src.dump}]" #=> ["\e$B$O$... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol (9149.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...きは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destinat......容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversi......put before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_emp... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (9149.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...きは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destinat......容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversi......put before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_emp... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (9149.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...きは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destinat......容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversi......put before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_emp... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (9149.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...きは、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destinat......容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversi......put before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_emp...