1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix a documentation error of IO#putc.

IO#putc is multi-byte character safe when a String is given as its argument.
[ruby-core:82019] [Bug #13741]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2017-12-03 08:10:42 +00:00
parent 436fd82ab7
commit 3616b07c9a

8
io.c
View file

@ -7488,10 +7488,10 @@ rb_f_print(int argc, const VALUE *argv)
* ios.putc(obj) -> obj
*
* If <i>obj</i> is <code>Numeric</code>, write the character whose code is
* the least-significant byte of <i>obj</i>, otherwise write the first byte
* of the string representation of <i>obj</i> to <em>ios</em>. Note: This
* method is not safe for use with multi-byte characters as it will truncate
* them.
* the least-significant byte of <i>obj</i>.
* If <i>obj</i> is <code>String</code>, write the first character
* of <i>obj</i> to <em>ios</em>.
* Otherwise, raise <code>TypeError</code>.
*
* $stdout.putc "A"
* $stdout.putc 65