From: Brian Candler Date: 2009-07-29T19:32:39+09:00 Subject: Re: upcase in 1.9.2-preview1 Brian Candler wrote: > Can someone confirm whether this is intentional or not? > >>> s = "端ber" > => "端ber" >>> s.upcase > => "端BER" To answer my own question: looking at the source code, it looks like this *is* intentional. From encoding.c: int rb_enc_toupper(int c, rb_encoding *enc) { return (ONIGENC_IS_ASCII_CODE(c)?ONIGENC_ASCII_CODE_TO_UPPER_CASE(c):(c)); } int rb_enc_tolower(int c, rb_encoding *enc) { return (ONIGENC_IS_ASCII_CODE(c)?ONIGENC_ASCII_CODE_TO_LOWER_CASE(c):(c)); } That is: only ASCII characters (potentially encoded as UTF16 or whatever) are eligible for case conversion. -- Posted via http://www.ruby-forum.com/.