From b19494fd6ad74da9871b6d4339c3b6e612d980a7 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 16 Oct 2007 17:50:51 +0000 Subject: * string.c (rb_str_ord): use encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string.c') diff --git a/string.c b/string.c index 40450bc17..0179ab056 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); } /* -- cgit