From 79b1758b65563815abb5d626a21b597e39fcfea4 Mon Sep 17 00:00:00 2001 From: duerst Date: Wed, 6 Jul 2016 09:34:23 +0000 Subject: [PATCH] * enc/iso_8859_16.c, test/ruby/enc/test_case_comprehensive.rb: Implement non-ASCII case conversion for ISO-8859-16, by Satoshi Kayama. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++ enc/iso_8859_16.c | 58 +++++++++++++++++++++++- test/ruby/enc/test_case_comprehensive.rb | 2 +- 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c22e1151d2..e1bac8fe0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 6 18:34:21 2016 Martin Duerst + + * enc/iso_8859_16.c, test/ruby/enc/test_case_comprehensive.rb: + Implement non-ASCII case conversion for ISO-8859-16, by Satoshi Kayama. + Wed Jul 6 14:44:56 2016 Nobuyoshi Nakada * lib/mkmf.rb (create_makefile): store $headers in LOCAL_HDRS for diff --git a/enc/iso_8859_16.c b/enc/iso_8859_16.c index 7e04403872..2ed2f3c989 100644 --- a/enc/iso_8859_16.c +++ b/enc/iso_8859_16.c @@ -222,6 +222,62 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag, flag, p, end, items); } +#ifdef ONIG_CASE_MAPPING +static int +case_map (OnigCaseFoldType* flagP, const OnigUChar** pp, + const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, + const struct OnigEncodingTypeST* enc) +{ + OnigCodePoint code; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp