aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-16 17:50:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-16 17:50:51 +0000
commitb1d53d10e2805932b094ed7316d5395435728dd6 (patch)
tree518cdcd64cc1c2ca082d86ec54b16ef4d478d2e9 /string.c
parent81ed881511962bbd3d03f8c02c190ad247883aa5 (diff)
downloadruby-b1d53d10e2805932b094ed7316d5395435728dd6.tar.gz
* string.c (rb_str_ord): use encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
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);
}
/*