From e3d25e78eb73c7b7bce0cd175578f7ce32741c5f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 28 Jul 2017 13:02:25 +0200 Subject: Fixed bug #62934 --- NEWS | 2 ++ ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c | 4 ++-- ext/mbstring/tests/bug62934.phpt | 10 ++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 ext/mbstring/tests/bug62934.phpt diff --git a/NEWS b/NEWS index 2f1e2bcaa8..239b1077d0 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,8 @@ PHP NEWS - Mbstring: . Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding). (cmb) + . Fixed bug #62934 (mb_convert_kana() does not convert iteration marks). + (Nikita) - MySQLi: . Fixed bug #74968 (PHP crashes when calling mysqli_result::fetch_object with diff --git a/ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c b/ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c index 4d075e51d4..637e69074c 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c @@ -222,11 +222,11 @@ mbfl_filt_tl_jisx0201_jisx0208(int c, mbfl_convert_filter *filt) } else if (mode & (MBFL_FILT_TL_ZEN2HAN_HIRA2KANA | MBFL_FILT_TL_ZEN2HAN_KANA2HIRA)) { if ((mode & MBFL_FILT_TL_ZEN2HAN_HIRA2KANA) && - c >= 0x3041 && c <= 0x3093) { + ((c >= 0x3041 && c <= 0x3093) || c == 0x309d || c == 0x309e)) { /* Zenkaku hirangana to Zenkaku katakana */ s = c + 0x60; } else if ((mode & MBFL_FILT_TL_ZEN2HAN_KANA2HIRA) && - c >= 0x30a1 && c <= 0x30f3) { + ((c >= 0x30a1 && c <= 0x30f3) || c == 0x30fd || c == 0x30fe)) { /* Zenkaku katakana to Zenkaku hirangana */ s = c - 0x60; } diff --git a/ext/mbstring/tests/bug62934.phpt b/ext/mbstring/tests/bug62934.phpt new file mode 100644 index 0000000000..f3521a97c6 --- /dev/null +++ b/ext/mbstring/tests/bug62934.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #62934: mb_convert_kana() does not convert iteration marks +--FILE-- + +--EXPECT-- +アヽスヾメアヽスヾメ +あゝすゞめあゝすゞめ -- cgit v1.2.1