Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ PHP NEWS
- Mbstring:
. ini_set() with mbstring.detect_order changes the order of mb_detect_order
as intended, since mbstring.detect_order is an INI_ALL setting. (tobee94)
. Added GB18030-2022 to default encoding list for zh-CN. (HeRaNO)

- Opcache:
. Fixed bug GH-20051 (apache2 shutdowns when restart is requested during
Expand Down
3 changes: 3 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES
. Removed the XML_GetCurrentByteCount() libxml compatibility wrapper,
as it was unused and could return the wrong result.

- ext/mbstring:
. Added GB18030-2022 to default encoding list for zh-CN.

========================
4. OpCode changes
========================
Expand Down
3 changes: 2 additions & 1 deletion ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ static const enum mbfl_no_encoding php_mb_default_identify_list_cn[] = {
mbfl_no_encoding_ascii,
mbfl_no_encoding_utf8,
mbfl_no_encoding_euc_cn,
mbfl_no_encoding_cp936
mbfl_no_encoding_cp936,
mbfl_no_encoding_gb18030_2022
};

static const enum mbfl_no_encoding php_mb_default_identify_list_tw_hk[] = {
Expand Down
24 changes: 24 additions & 0 deletions ext/mbstring/tests/zh_CN_default_encodings.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--TEST--
Default encodings in Simplified Chinese
--EXTENSIONS--
mbstring
--INI--
mbstring.language=Simplified Chinese
--FILE--
<?php
var_dump(mb_detect_order());

?>
--EXPECT--
array(5) {
[0]=>
string(5) "ASCII"
[1]=>
string(5) "UTF-8"
[2]=>
string(6) "EUC-CN"
[3]=>
string(5) "CP936"
[4]=>
string(12) "GB18030-2022"
}