From 020bd635acc3f2f2c53ea1e55f0e6005677367c5 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 10 Jun 2010 00:11:26 +0000 Subject: * io.c (rb_io_putc): documentation updated to mention putc would not work well with multi-byte characters. [ruby-core:30697] * io.c (rb_f_putc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ io.c | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7715ed97bf..20172e0c11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Jun 10 09:10:08 2010 Yukihiro Matsumoto + + * io.c (rb_io_putc): documentation updated to mention putc would + not work well with multi-byte characters. [ruby-core:30697] + + * io.c (rb_f_putc): ditto. + Wed Jun 9 22:51:50 2010 Tanaka Akira * time.c (find_time_t): always outerpolate from past. diff --git a/io.c b/io.c index d010f38374..e293728847 100644 --- a/io.c +++ b/io.c @@ -6012,9 +6012,11 @@ rb_f_print(int argc, VALUE *argv) * call-seq: * ios.putc(obj) -> obj * - * If obj is Numeric, write the character whose - * code is obj, otherwise write the first character of the - * string representation of obj to ios. + * If obj is Numeric, write the character whose code is + * the least-significant byte of obj, otherwise write the first byte + * of the string representation of obj to ios. Note: This + * method is not safe for use with multi-byte characters as it will truncate + * them. * * $stdout.putc "A" * $stdout.putc 65 @@ -6040,6 +6042,9 @@ rb_io_putc(VALUE io, VALUE ch) * Equivalent to: * * $stdout.putc(int) + * + * Refer to the documentation for IO#putc for important information regarding + * multi-byte characters. */ static VALUE -- cgit v1.2.3