From b1d53d10e2805932b094ed7316d5395435728dd6 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 16 Oct 2007 17:50:51 +0000 Subject: [PATCH] * string.c (rb_str_ord): use encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ string.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 536fbbad35..a348c9a6d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Oct 17 02:50:49 2007 Nobuyoshi Nakada + + * string.c (rb_str_ord): use encoding. + Wed Oct 17 01:57:06 2007 Nobuyoshi Nakada * re.c (rb_reg_initialize_m): allow binary encoding option. diff --git a/string.c b/string.c index 40450bc17c..0179ab0564 100644 --- a/string.c +++ b/string.c @@ -4751,7 +4751,7 @@ rb_str_ord(VALUE s) { int c; - c = RSTRING_PTR(s)[0] & 0xff; + c = rb_enc_codepoint(RSTRING_PTR(s), RSTRING_END(s), rb_enc_get(s)); return INT2NUM(c); } /*