From 02f7ad6237466d552c21f1cc78acd33febaa5ee6 Mon Sep 17 00:00:00 2001 From: duerst Date: Sat, 11 Jun 2016 00:46:21 +0000 Subject: * enc/iso_8859_1.c: Implement non-ASCII case mapping. * test/ruby/enc/test_case_comprehensive.rb: Tests for above. * string.c: Add iso-8859-1 to supported encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enc/iso_8859_1.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'enc/iso_8859_1.c') diff --git a/enc/iso_8859_1.c b/enc/iso_8859_1.c index 10f63cc28e..5f0d3f91ab 100644 --- a/enc/iso_8859_1.c +++ b/enc/iso_8859_1.c @@ -254,6 +254,49 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSE return FALSE; } +#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, lower; + OnigUChar *to_start = to; + OnigCaseFoldType flags = *flagP; + + while (*pp