[ruby-cvs:73401] duerst:r66300 (trunk): implement special behavior for Georgian for String#capitalize

duerst at ruby-lang.org duerst at ruby-lang.org
Mon Dec 10 08:14:29 JST 2018


duerst	2018-12-10 08:14:29 +0900 (Mon, 10 Dec 2018)

  New Revision: 66300

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66300

  Log:
    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.

  Modified files:
    trunk/enc/unicode.c
    trunk/string.c
    trunk/test/ruby/enc/test_case_comprehensive.rb
    trunk/test/ruby/enc/test_case_mapping.rb


More information about the ruby-cvs mailing list