Skip to content

Commit 2ca0db6

Browse files
committed
修复 iconv.cs 文件
1 parent cbabfb4 commit 2ca0db6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Peachpie.Library/iconv.cs

+14
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ namespace Pchp.Library
1515
[PhpExtension("iconv", Registrator = typeof(PhpIconv.Registrator))]
1616
public static class PhpIconv
1717
{
18+
/// <summary>
19+
/// wjw add 2024-04-08 增加一个静态构造,汉字编码支持 18行
20+
/// </summary>
21+
static PhpIconv()
22+
{
23+
try
24+
{
25+
Encoding.GetEncoding("GBK");
26+
}
27+
catch (Exception)
28+
{
29+
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
30+
}
31+
}
1832
#region IconvConfig, Options
1933

2034
sealed class IconvConfig : IPhpConfiguration

0 commit comments

Comments
 (0)