mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_ord): use encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
81ed881511
commit
b1d53d10e2
2 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Wed Oct 17 02:50:49 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_str_ord): use encoding.
|
||||||
|
|
||||||
Wed Oct 17 01:57:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Oct 17 01:57:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* re.c (rb_reg_initialize_m): allow binary encoding option.
|
* re.c (rb_reg_initialize_m): allow binary encoding option.
|
||||||
|
|
2
string.c
2
string.c
|
@ -4751,7 +4751,7 @@ rb_str_ord(VALUE s)
|
||||||
{
|
{
|
||||||
int c;
|
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);
|
return INT2NUM(c);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue