clarifiy 'codepoint' in documentation of String#each_codepoint
Make sure it's clear that the returned values are not Unicode codepoints for encodings other than UTF-8/UTF-16(BE|LE)/UTF-32(BE|LE). [ci skip] [Bug #13321] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
77e1c20b8a
commit
67c1197835
6
string.c
6
string.c
@ -4147,7 +4147,7 @@ str_upto_each(VALUE beg, VALUE end, int excl, int (*each)(VALUE, VALUE), VALUE a
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ID op = excl ? '<' : idLE;
|
ID op = excl ? '<' : idLE;
|
||||||
VALUE args[2], fmt = rb_fstring_cstr("%.*d");
|
VALUE args[2], fmt = rb_obj_freeze(rb_usascii_str_new_cstr("%.*d"));
|
||||||
|
|
||||||
args[0] = INT2FIX(width);
|
args[0] = INT2FIX(width);
|
||||||
while (rb_funcall(b, op, 1, e)) {
|
while (rb_funcall(b, op, 1, e)) {
|
||||||
@ -7965,7 +7965,9 @@ rb_str_enumerate_codepoints(VALUE str, int wantarray)
|
|||||||
*
|
*
|
||||||
* Passes the <code>Integer</code> ordinal of each character in <i>str</i>,
|
* Passes the <code>Integer</code> ordinal of each character in <i>str</i>,
|
||||||
* also known as a <i>codepoint</i> when applied to Unicode strings to the
|
* also known as a <i>codepoint</i> when applied to Unicode strings to the
|
||||||
* given block.
|
* given block. For encodings other than UTF-8/UTF-16(BE|LE)/UTF-32(BE|LE),
|
||||||
|
* values are directly derived from the binary representation
|
||||||
|
* of each character.
|
||||||
*
|
*
|
||||||
* If no block is given, an enumerator is returned instead.
|
* If no block is given, an enumerator is returned instead.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user