1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/enc
duerst 3628eae2e7 implement special behavior for Georgian for String#capitalize
The modern Georgian script is special in that it has an 'uppercase'
variant called MTAVRULI which can be used for emphasis of whole words,
for screamy headlines, and so on. However, in contrast to all other
bicameral scripts, there is no usage of capitalizing the first letter
in a word or a sentence. Words with mixed capitalization are not used
at all.

We therefore implement special behavior for String#capitalize. Formally,
we define String#capitalize as first applying String#downcase for the
whole string, then using titlecase on the first letter. Because Georgian
defines titlecase as the identity function both for MTAVRULI ('uppercase')
and Mkhedruli (lowercase), this results in String#capitalize being
equivalent to String#downcase for Georgian. This avoids undesirable
mixed case.

* enc/unicode.c: Actual implementation

* string.c: Add mention of this special case for documentation

* test/ruby/enc/test_case_mapping.rb: Add two tests, a general one
  that uses String#capitalize on some (including nonsensical)
  combinations of MTAVRULI and Mkhedruli, and a canary test to
  detect the potential assignment of characters to the currently
  open slots (holes) at U+1CBB and U+1CBC.

* test/ruby/enc/test_case_comprehensive.rb: Tweak generation of
  expectation data.

Together with r65933, this closes issue #14839.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-09 23:14:29 +00:00
..
jis gperf.sed: static declarations 2017-12-15 14:42:43 +00:00
trans replace copyrights by explanatory text in data files for GB2312/GB12345 mappings 2017-09-01 10:22:09 +00:00
unicode delete Unicode 10.0.0 related files, no longer needed [#14802] 2018-12-09 02:02:45 +00:00
ascii.c
big5.c
cp949.c
depend ruby tool/update-deps --fix 2018-07-05 12:48:45 +00:00
ebcdic.h
emacs_mule.c
encdb.c
encinit.c.erb
euc_jp.c
euc_kr.c
euc_tw.c
gb2312.c
gb18030.c
gbk.c
iso_2022_jp.h
iso_8859.h
iso_8859_1.c
iso_8859_2.c
iso_8859_3.c
iso_8859_4.c
iso_8859_5.c
iso_8859_6.c
iso_8859_7.c
iso_8859_8.c
iso_8859_9.c
iso_8859_10.c
iso_8859_11.c
iso_8859_13.c
iso_8859_14.c
iso_8859_15.c
iso_8859_16.c
koi8_r.c
koi8_u.c
make_encmake.rb Refactor ERB version checking for keyword arguments 2018-02-27 11:12:23 +00:00
Makefile.in
mktable.c
shift_jis.c Update to Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05. 2017-12-01 13:50:13 +00:00
shift_jis.h Add missing file 2017-12-01 14:08:13 +00:00
unicode.c implement special behavior for Georgian for String#capitalize 2018-12-09 23:14:29 +00:00
us_ascii.c
utf_7.h
utf_8.c Change max byte length of UTF-8 to 4 bytes 2017-05-30 05:43:41 +00:00
utf_16_32.h
utf_16be.c
utf_16le.c
utf_32be.c
utf_32le.c
windows_31j.c Update to Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05. 2017-12-01 13:50:13 +00:00
windows_1250.c
windows_1251.c
windows_1252.c
windows_1253.c
windows_1254.c
windows_1257.c
x_emoji.h