mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Revert r55225
Run test-all before large commit:
"* string.c: Activate full Unicode case mapping for UTF-8 by removing"
This reverts commit 3fb0fcd1e8
.
http://rubyci.s3.amazonaws.com/centos5-64/ruby-trunk/log/20160531T013303Z.fail.html.gz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3fb0fcd1e8
commit
e6ff652ce8
3 changed files with 21 additions and 31 deletions
|
@ -1,11 +1,3 @@
|
||||||
Tue May 31 10:10:03 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
|
||||||
|
|
||||||
* string.c: Activate full Unicode case mapping for UTF-8 by removing
|
|
||||||
the protective check for the presence of an option.
|
|
||||||
Update documentation.
|
|
||||||
|
|
||||||
* test/ruby/enc/test_case_comprehensive.rb: Adjust tests for above change.
|
|
||||||
|
|
||||||
Tue May 31 00:30:11 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
Tue May 31 00:30:11 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* ext/socket/raddrinfo.c (host_str, port_str): Use StringValueCStr
|
* ext/socket/raddrinfo.c (host_str, port_str): Use StringValueCStr
|
||||||
|
|
36
string.c
36
string.c
|
@ -5850,7 +5850,7 @@ rb_str_upcase_bang(int argc, VALUE *argv, VALUE str)
|
||||||
enc = STR_ENC_GET(str);
|
enc = STR_ENC_GET(str);
|
||||||
rb_str_check_dummy_enc(enc);
|
rb_str_check_dummy_enc(enc);
|
||||||
s = RSTRING_PTR(str); send = RSTRING_END(str);
|
s = RSTRING_PTR(str); send = RSTRING_END(str);
|
||||||
if (enc==rb_utf8_encoding()) {
|
if (enc==rb_utf8_encoding() && argc>0) { /* :lithuanian can temporarily be used for new functionality without options */
|
||||||
str_shared_replace(str, rb_str_casemap(str, &flags, enc));
|
str_shared_replace(str, rb_str_casemap(str, &flags, enc));
|
||||||
modify = ONIGENC_CASE_MODIFIED & flags;
|
modify = ONIGENC_CASE_MODIFIED & flags;
|
||||||
}
|
}
|
||||||
|
@ -5940,7 +5940,7 @@ rb_str_downcase_bang(int argc, VALUE *argv, VALUE str)
|
||||||
enc = STR_ENC_GET(str);
|
enc = STR_ENC_GET(str);
|
||||||
rb_str_check_dummy_enc(enc);
|
rb_str_check_dummy_enc(enc);
|
||||||
s = RSTRING_PTR(str); send = RSTRING_END(str);
|
s = RSTRING_PTR(str); send = RSTRING_END(str);
|
||||||
if (enc==rb_utf8_encoding()) {
|
if (enc==rb_utf8_encoding() && argc>0) { /* :lithuanian can temporarily be used for new functionality without options */
|
||||||
str_shared_replace(str, rb_str_casemap(str, &flags, enc));
|
str_shared_replace(str, rb_str_casemap(str, &flags, enc));
|
||||||
modify = ONIGENC_CASE_MODIFIED & flags;
|
modify = ONIGENC_CASE_MODIFIED & flags;
|
||||||
}
|
}
|
||||||
|
@ -5999,11 +5999,11 @@ rb_str_downcase_bang(int argc, VALUE *argv, VALUE str)
|
||||||
* The meaning of the +options+ is as follows:
|
* The meaning of the +options+ is as follows:
|
||||||
*
|
*
|
||||||
* No option ::
|
* No option ::
|
||||||
* Full Unicode case mapping, suitable for most languages
|
* Currently, old behavior (only the ASCII region, i.e. characters
|
||||||
* (see :turkic and :lithuanian options below for exceptions)
|
* ``A'' to ``Z'', and/or ``a'' to ``z'', are affected).
|
||||||
|
* This will change very soon to full Unicode case mapping.
|
||||||
* :ascii ::
|
* :ascii ::
|
||||||
* Only the ASCII region, i.e. the characters ``A'' to ``Z'' and
|
* Only the ASCII region, i.e. the characters ``A'' to ``Z'', are affected.
|
||||||
* ``a'' to ``z'', are affected.
|
|
||||||
* This option cannot be combined with any other option.
|
* This option cannot be combined with any other option.
|
||||||
* :turkic ::
|
* :turkic ::
|
||||||
* Full Unicode case mapping, adapted for Turkic languages
|
* Full Unicode case mapping, adapted for Turkic languages
|
||||||
|
@ -6012,23 +6012,21 @@ rb_str_downcase_bang(int argc, VALUE *argv, VALUE str)
|
||||||
* :lithuanian ::
|
* :lithuanian ::
|
||||||
* Currently, just full Unicode case mapping. In the future, full Unicode
|
* Currently, just full Unicode case mapping. In the future, full Unicode
|
||||||
* case mapping adapted for Lithuanian (keeping the dot on the lower case
|
* case mapping adapted for Lithuanian (keeping the dot on the lower case
|
||||||
* i even if there is an accent on top).
|
* i even if there's an accent on top).
|
||||||
* :fold ::
|
* :fold ::
|
||||||
* Only available on +downcase+ and +downcase!+. Unicode case <b>folding</b>,
|
* Only available on +downcase+ and +downcase!+. Unicode case folding, which
|
||||||
* which is more far-reaching than Unicode case mapping.
|
* is more far-reaching than Unicode case mapping. This option currently
|
||||||
* This option currently cannot be combined with any other option
|
* cannot be combined with any other option (i.e. we do not currenty
|
||||||
* (i.e. we do not currenty implement a variant for turkic languages).
|
* implement a variant for turkic languages).
|
||||||
*
|
*
|
||||||
* Please note that several assumptions that are valid for ASCII-only case
|
* Please note that several assumptions that are valid for ASCII-only case
|
||||||
* conversions do not hold for more general case conversions. For example,
|
* conversions do not hold for more general case conversions. For example,
|
||||||
* the length of the result may not be the same as the length of the input
|
* the length of the result may not be the same as the length of the input
|
||||||
* (neither in characters nor in bytes), some roundtrip assumptions
|
* (neither in characters nor in bytes), and some roundtrip assumptions
|
||||||
* (e.g. str.downcase == str.upcase.downcase) may not apply, and Unicode
|
* (e.g. str.downcase == str.downcase.upcase.downcase) may not apply.
|
||||||
* normalization (i.e. String#unicode_normalize) is not necessarily maintained
|
|
||||||
* by case mapping operations.
|
|
||||||
*
|
*
|
||||||
* Non-ASCII case mapping/folding is currently only supported for UTF-8
|
* Non-ASCII case mapping/folding is currently only supported for UTF-8 Strings,
|
||||||
* Strings/Symbols, but this support will be extended to other encodings.
|
* but this support will be extended to other encodings in the future.
|
||||||
*
|
*
|
||||||
* "hEllO".downcase #=> "hello"
|
* "hEllO".downcase #=> "hello"
|
||||||
*/
|
*/
|
||||||
|
@ -6073,7 +6071,7 @@ rb_str_capitalize_bang(int argc, VALUE *argv, VALUE str)
|
||||||
enc = STR_ENC_GET(str);
|
enc = STR_ENC_GET(str);
|
||||||
rb_str_check_dummy_enc(enc);
|
rb_str_check_dummy_enc(enc);
|
||||||
if (RSTRING_LEN(str) == 0 || !RSTRING_PTR(str)) return Qnil;
|
if (RSTRING_LEN(str) == 0 || !RSTRING_PTR(str)) return Qnil;
|
||||||
if (enc==rb_utf8_encoding()) {
|
if (enc==rb_utf8_encoding() && argc>0) { /* :lithuanian can temporarily be used for new functionality without options */
|
||||||
str_shared_replace(str, rb_str_casemap(str, &flags, enc));
|
str_shared_replace(str, rb_str_casemap(str, &flags, enc));
|
||||||
modify = ONIGENC_CASE_MODIFIED & flags;
|
modify = ONIGENC_CASE_MODIFIED & flags;
|
||||||
}
|
}
|
||||||
|
@ -6149,7 +6147,7 @@ rb_str_swapcase_bang(int argc, VALUE *argv, VALUE str)
|
||||||
enc = STR_ENC_GET(str);
|
enc = STR_ENC_GET(str);
|
||||||
rb_str_check_dummy_enc(enc);
|
rb_str_check_dummy_enc(enc);
|
||||||
s = RSTRING_PTR(str); send = RSTRING_END(str);
|
s = RSTRING_PTR(str); send = RSTRING_END(str);
|
||||||
if (enc==rb_utf8_encoding()) {
|
if (enc==rb_utf8_encoding() && argc>0) { /* :lithuanian can temporarily be used for new functionality without options */
|
||||||
str_shared_replace(str, rb_str_casemap(str, &flags, enc));
|
str_shared_replace(str, rb_str_casemap(str, &flags, enc));
|
||||||
modify = ONIGENC_CASE_MODIFIED & flags;
|
modify = ONIGENC_CASE_MODIFIED & flags;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,10 +78,10 @@ class TestComprehensiveCaseFold < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
tests = [
|
tests = [
|
||||||
CaseTest.new(:downcase, [], downcase),
|
CaseTest.new(:downcase, [:lithuanian], downcase),
|
||||||
CaseTest.new(:upcase, [], upcase),
|
CaseTest.new(:upcase, [:lithuanian], upcase),
|
||||||
CaseTest.new(:capitalize, [], titlecase, downcase),
|
CaseTest.new(:capitalize, [:lithuanian], titlecase, downcase),
|
||||||
# @@@@ TODO: figure out how to test swapcase
|
# swapcase?????!!!!!
|
||||||
CaseTest.new(:downcase, [:fold], casefold),
|
CaseTest.new(:downcase, [:fold], casefold),
|
||||||
CaseTest.new(:upcase, [:turkic], turkic_upcase),
|
CaseTest.new(:upcase, [:turkic], turkic_upcase),
|
||||||
CaseTest.new(:downcase, [:turkic], turkic_downcase),
|
CaseTest.new(:downcase, [:turkic], turkic_downcase),
|
||||||
|
|
Loading…
Reference in a new issue