com php-src: Convert Unicode halfwidth Yen sign to MacJapanese halfwidth Yen sign: ext/mbstring/libmbfl/filters/mbfilter_sjis_mac. c

From: Date: Wed, 11 Nov 2020 09:18:58 +0000
Subject: com php-src: Convert Unicode halfwidth Yen sign to MacJapanese halfwidth Yen sign: ext/mbstring/libmbfl/filters/mbfilter_sjis_mac. c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-114118@lists.php.net to get a copy of this message
Commit: 7f0e86b2dc02e85ad02ced9ed851c3fc5594d800 Author: Alex Dowad <alexinbeijing@gmail.com> Sat, 19 Sep 2020 14:27:14 +0200 Parents: 4c39cd3d1d3cf1d2f490876d808696ab8872d139 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7f0e86b2dc02e85ad02ced9ed851c3fc5594d800 Log: 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. Changed paths: M ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c Diff: diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c index e794e1775ae..5214c429983 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; }

« previous php.cvs (#114118) next »