[php-src] Issue #8308: The return value of mb_list_encodings() doesn't contain 'SJIS-win'

From: Date: Thu, 07 Apr 2022 14:33:35 +0000
Subject: [php-src] Issue #8308: The return value of mb_list_encodings() doesn't contain 'SJIS-win'
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-240760@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8308 Comment Author: zonuexe @alexdowad > I've not yet read through the references provided by @zonuexe on > https://github.com/php/php-src/issues/8281, so maybe this is already > covered there, but can you explain any reasons why one might recommend the use of Ÿâù9�� > B}’TžA8QCP932, or conversely, might recommend > SJIS-win? Unfortunately, these encodings are not named according to standard specifications. Both Java and Ruby have a different set of encoding names about for SJIS variants than PHP's mbstring. * Ruby * [class Encoding - Documentation for Ruby 3.2](https://docs.ruby-lang.org/en/master/Encoding.html) * [class Encoding (Ruby 3.1 リファレンスマニュアル)](https://docs.ruby-lang.org/ja/latest/class/Encoding.html) - English manual does not have a full list of constants * [ruby/enc at v3_1_1 · ruby/ruby](https://github.com/ruby/ruby/tree/v3_1_1/enc) * Java * [Supported Encodings](https://docs.oracle.com/en/java/javase/17/intl/supported-encodings.html#GUID-187BA718-195F-4C39-B0D5-F3FDF02C7205) * [jdk/charsets at jdk-19+17 · openjdk/jdk](https://github.com/openjdk/jdk/blob/jdk-19+17/make/data/charsetmapping/charsets) mbstring originates from the [PHP3 漢字パッチ(Kanji patch)](https://web.archive.org/web/19990508055729/http://www.softagency.co.jp/mysql/php3-kanji.html), which is based on a library called libkkc or "streamable kanji code filter and converter". I haven't seen the full code at that time, but there is evidence that sjis-win was added earlier in [the first commit of libmbfl](https://github.com/moriyoshi/libmbfl/commit/6c6ea25dd04aecc4260f0231b8158cc36b5e66a3). One of the original authors, @moriyoshi, said that [SJIS-win and CP932 needed to be separated in order to comply with "some specifications"](https://twitter.com/moriyoshit/status/1511894772494991360). They forget which spec they followed, but the important fact is that for 20 years many users have relied on the name SJIS-win and the conversion map.

« previous php.bugs (#240760) next »