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 * ios.putc(obj) -> obj
* *
* If <i>obj</i> is <code>Numeric</code>, write the character whose code is * 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 * the least-significant byte of <i>obj</i>.
* of the string representation of <i>obj</i> to <em>ios</em>. Note: This * If <i>obj</i> is <code>String</code>, write the first character
* method is not safe for use with multi-byte characters as it will truncate * of <i>obj</i> to <em>ios</em>.
* them. * Otherwise, raise <code>TypeError</code>.
* *
* $stdout.putc "A" * $stdout.putc "A"
* $stdout.putc 65 * $stdout.putc 65