aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
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);
}
/*