Skip to content

Commit e4bad32

Browse files
committed
Add GB18030-2022 to default encoding list for zh-CN
1 parent ada7400 commit e4bad32

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ PHP NEWS
2020
. Fixed bug GH-20483 (ASAN stack overflow with fiber.stack_size INI
2121
small value). (David Carlier)
2222

23+
- Mbstring:
24+
. Added GB18030-2022 to default encoding list for zh-CN. (HeRaNO)
25+
2326
- Opcache:
2427
. Fixed bug GH-20051 (apache2 shutdowns when restart is requested during
2528
preloading). (Arnaud, welcomycozyhom)

UPGRADING.INTERNALS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES
6464
. Removed the XML_GetCurrentByteCount() libxml compatibility wrapper,
6565
as it was unused and could return the wrong result.
6666

67+
- ext/mbstring:
68+
. Added GB18030-2022 to default encoding list for zh-CN.
69+
6770
========================
6871
4. OpCode changes
6972
========================

ext/mbstring/mbstring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ static const enum mbfl_no_encoding php_mb_default_identify_list_cn[] = {
116116
mbfl_no_encoding_ascii,
117117
mbfl_no_encoding_utf8,
118118
mbfl_no_encoding_euc_cn,
119-
mbfl_no_encoding_cp936
119+
mbfl_no_encoding_cp936,
120+
mbfl_no_encoding_gb18030_2022
120121
};
121122

122123
static const enum mbfl_no_encoding php_mb_default_identify_list_tw_hk[] = {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Default encodings in Simplified Chinese
3+
--EXTENSIONS--
4+
mbstring
5+
--INI--
6+
mbstring.language=Simplified Chinese
7+
--FILE--
8+
<?php
9+
var_dump(mb_detect_order());
10+
11+
?>
12+
--EXPECT--
13+
array(5) {
14+
[0]=>
15+
string(5) "ASCII"
16+
[1]=>
17+
string(5) "UTF-8"
18+
[2]=>
19+
string(6) "EUC-CN"
20+
[3]=>
21+
string(5) "CP936"
22+
[4]=>
23+
string(12) "GB18030-2022"
24+
}

0 commit comments

Comments
 (0)