Skip to content

Commit a50607d

Browse files
committed
CP5022{0,1,2}: use JISX0201 for U+203E (overline)
Same issue as d497c0e addressed for JIS7/JIS8, but for CP5022{0,1,2} this time.
1 parent 5e5243a commit a50607d

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,14 @@ mbfl_filt_conv_wchar_cp50220raw(int c, mbfl_convert_filter *filter)
587587
/*
588588
* wchar => CP50221
589589
*/
590-
int
591-
mbfl_filt_conv_wchar_cp50221(int c, mbfl_convert_filter *filter)
590+
int mbfl_filt_conv_wchar_cp50221(int c, mbfl_convert_filter *filter)
592591
{
593592
int s = 0;
594593

595594
if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) {
596595
s = ucs_a1_jis_table[c - ucs_a1_jis_table_min];
596+
} else if (c == 0x203E) { /* OVERLINE */
597+
s = 0x1007E; /* Convert to JISX 0201 OVERLINE */
597598
} else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) {
598599
s = ucs_a2_jis_table[c - ucs_a2_jis_table_min];
599600
} else if (c >= ucs_i_jis_table_min && c < ucs_i_jis_table_max) {
@@ -609,8 +610,6 @@ mbfl_filt_conv_wchar_cp50221(int c, mbfl_convert_filter *filter)
609610
if (s <= 0) {
610611
if (c == 0xa5) { /* YEN SIGN */
611612
s = 0x1005c;
612-
} else if (c == 0x203e) { /* OVER LINE */
613-
s = 0x1007e;
614613
} else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */
615614
s = 0x2140;
616615
} else if (c == 0x2225) { /* PARALLEL TO */
@@ -730,15 +729,14 @@ mbfl_filt_conv_wchar_cp50221(int c, mbfl_convert_filter *filter)
730729
/*
731730
* wchar => CP50222
732731
*/
733-
int
734-
mbfl_filt_conv_wchar_cp50222(int c, mbfl_convert_filter *filter)
732+
int mbfl_filt_conv_wchar_cp50222(int c, mbfl_convert_filter *filter)
735733
{
736-
int s;
737-
738-
s = 0;
734+
int s = 0;
739735

740736
if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) {
741737
s = ucs_a1_jis_table[c - ucs_a1_jis_table_min];
738+
} else if (c == 0x203E) { /* OVERLINE */
739+
s = 0x1007E; /* Convert to JISX 0201 OVERLINE */
742740
} else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) {
743741
s = ucs_a2_jis_table[c - ucs_a2_jis_table_min];
744742
} else if (c >= ucs_i_jis_table_min && c < ucs_i_jis_table_max) {
@@ -754,8 +752,6 @@ mbfl_filt_conv_wchar_cp50222(int c, mbfl_convert_filter *filter)
754752
if (s <= 0) {
755753
if (c == 0xa5) { /* YEN SIGN */
756754
s = 0x1005c;
757-
} else if (c == 0x203e) { /* OVER LINE */
758-
s = 0x1007e;
759755
} else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */
760756
s = 0x2140;
761757
} else if (c == 0x2225) { /* PARALLEL TO */

0 commit comments

Comments
 (0)