From ef6405f71cbc73864a4ee4a46c9ab6d5ccd16959 Mon Sep 17 00:00:00 2001 From: duerst Date: Tue, 24 May 2016 23:01:39 +0000 Subject: [PATCH] * enc/unicode.c: Fix flag error for switch from titlecase to lowercase. * test/ruby/enc/test_case_mapping.rb: Tests for above error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ enc/unicode.c | 5 ++++- test/ruby/enc/test_case_mapping.rb | 27 ++++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8fa625051..d017319a41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed May 25 08:01:39 2016 Martin Duerst + + * enc/unicode.c: Fix flag error for switch from titlecase to lowercase. + + * test/ruby/enc/test_case_mapping.rb: Tests for above error. + Wed May 25 01:13:55 2016 Kazuki Yamaguchi * ext/openssl/ossl_pkey_ec.c (ec_key_new_from_group): Create a new diff --git a/enc/unicode.c b/enc/unicode.c index 8f978bc9a7..22d1dda809 100644 --- a/enc/unicode.c +++ b/enc/unicode.c @@ -670,6 +670,8 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP, OnigUChar *to_start = to; OnigCaseFoldType flags = *flagP; to_end -= CASE_MAPPING_SLACK; + /* copy flags ONIGENC_CASE_UPCASE and ONIGENC_CASE_DOWNCASE over to + * ONIGENC_CASE_UP_SPECIAL and ONIGENC_CASE_DOWN_SPECIAL */ flags |= (flags&(ONIGENC_CASE_UPCASE|ONIGENC_CASE_DOWNCASE))< Greek Mu + check_downcase_properties 'µµµµµ', 'µµµµµ', :lithuanian # MICRO SIGN -> Greek Mu + check_capitalize_properties 'Μµµµµ', 'µµµµµ', :lithuanian # MICRO SIGN -> Greek Mu + check_capitalize_properties 'Μµµµµ', 'µµµµµ', :turkic # MICRO SIGN -> Greek Mu + check_capitalize_properties 'H̱ẖẖẖẖ', 'ẖẖẖẖẖ', :lithuanian + check_capitalize_properties 'Βϐϐϐϐ', 'ϐϐϐϐϐ', :lithuanian + check_capitalize_properties 'Θϑϑϑϑ', 'ϑϑϑϑϑ', :lithuanian + check_capitalize_properties 'Φϕ', 'ϕϕ', :lithuanian + check_capitalize_properties 'Πϖ', 'ϖϖ', :lithuanian + check_capitalize_properties 'Κϰ', 'ϰϰ', :lithuanian + check_capitalize_properties 'Ρϱϱ', 'ϱϱϱ', :lithuanian + check_capitalize_properties 'Εϵ', 'ϵϵ', :lithuanian + check_capitalize_properties 'Ιͅͅͅͅ', 'ͅͅͅͅͅ', :lithuanian + check_capitalize_properties 'Sſſſſ', 'ſſſſſ', :lithuanian + end + def test_various check_upcase_properties 'Μ', 'µ', :lithuanian # MICRO SIGN -> Greek Mu + check_downcase_properties 'µµµµµ', 'µµµµµ', :lithuanian # MICRO SIGN check_capitalize_properties 'Ss', 'ß', :lithuanian check_upcase_properties 'SS', 'ß', :lithuanian end