mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
31ad460358
commit
c2ba5cf9c5
1 changed files with 11 additions and 0 deletions
11
transcode.c
11
transcode.c
|
@ -2506,6 +2506,17 @@ econv_primitive_convert(int argc, VALUE *argv, VALUE self)
|
|||
* puts ec.convert("\u3042").dump #=> "\xA4\xA2"
|
||||
* puts ec.finish.dump #=> ""
|
||||
*
|
||||
* ec = Encoding::Converter.new("euc-jp", "utf-8")
|
||||
* puts ec.convert("\xA4").dump #=> ""
|
||||
* puts ec.convert("\xA2").dump #=> "\xE3\x81\x82"
|
||||
* puts ec.finish.dump #=> ""
|
||||
*
|
||||
* ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
|
||||
* puts ec.convert("\xE3").dump #=> "".force_encoding("ISO-2022-JP")
|
||||
* puts ec.convert("\x81").dump #=> "".force_encoding("ISO-2022-JP")
|
||||
* puts ec.convert("\x82").dump #=> "\e$B$\"".force_encoding("ISO-2022-JP")
|
||||
* puts ec.finish.dump #=> "\e(B".force_encoding("ISO-2022-JP")
|
||||
*
|
||||
* If a conversion error occur,
|
||||
* Encoding::ConversionUndefined or
|
||||
* Encoding::InvalidByteSequence is raised.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue