summaryrefslogtreecommitdiff
path: root/ext/mbstring/libmbfl/filters
diff options
context:
space:
mode:
authorAlex Dowad <alexinbeijing@gmail.com>2020-09-19 14:27:14 +0200
committerAlex Dowad <alexinbeijing@gmail.com>2020-11-11 11:18:58 +0200
commit7f0e86b2dc02e85ad02ced9ed851c3fc5594d800 (patch)
tree81b2160d1ae749c563c4b9ac269f11065ee38bd1 /ext/mbstring/libmbfl/filters
parent4c39cd3d1d3cf1d2f490876d808696ab8872d139 (diff)
downloadphp-git-7f0e86b2dc02e85ad02ced9ed851c3fc5594d800.tar.gz
Convert Unicode halfwidth Yen sign to MacJapanese halfwidth Yen sign
Since 1993, Unicode has had a specific codepoint for a fullwidth Yen sign. Likewise, MacJapanese has separate kuten codes for halfwidth and fullwidth Yen signs. But mbstring mapped _both_ Yen sign codepoints to the MacJapanese fullwidth Yen sign. It's probably more appropriate to map the 'ordinary' Yen sign to the MacJapanese halfwidth Yen sign. Besides, this means that the conversion between Unicode and MacJapanese is closer to being lossless and reversible.
Diffstat (limited to 'ext/mbstring/libmbfl/filters')
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c
index e794e1775a..5214c42998 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c
@@ -425,8 +425,10 @@ mbfl_filt_conv_wchar_sjis_mac(int c, mbfl_convert_filter *filter)
s1 |= 0x8080;
} else if (c == 0xa0) {
s1 = 0x00a0;
- } else if (c == 0xa5) { /* YEN SIGN */
- s1 = 0x216f; /* FULLWIDTH YEN SIGN */
+ } else if (c == 0xa5) { /* YEN SIGN */
+ /* Unicode has codepoint 0xFFE5 for a fullwidth Yen sign;
+ * convert codepoint 0xA5 to halfwidth Yen sign */
+ s1 = 0x5c; /* HALFWIDTH YEN SIGN */
} else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */
s1 = 0x2140;
}