hho2002

hho2002

V2EX 第 73063 号会员,加入于 2014-09-05 21:06:52 +08:00
hho2002 最近回复了
2022-05-25 19:16:32 +08:00
回复了 rockyliang 创建的主题 程序员 问一个关于 PHP 编码的问题
php.ini 中设置 output_encoding = "GBK" ,执行 GBK 编码文件,windows cmd 输出就正常了
2022-05-25 19:11:44 +08:00
回复了 rockyliang 创建的主题 程序员 问一个关于 PHP 编码的问题
php-7.1.1 版本修改

https://github.com/php/php-src/commit/e33ec61f9c1baa73bfe1b03b8c48a824ab2a867e

https://www.php.net/manual/zh/migration71.windows-support.php

The console output codepage is adjusted depending on the encoding used in PHP. Depending on the concrete system OEM codepage, the visible output might or might be not correct. For example, in the default cmd.exe and on a system with the OEM codepage 437, outputs in codepages 1251, 1252, 1253 and some others can be shown correctly when using UTF-8. On the same system, chars in codepage like 20932 probably won't be shown correctly. This refers to the particular system rules for codepage, font compatibility and the particular console program used. PHP automatically sets the console codepage according to the encoding rules from php.ini. Using alternative consoles instead of cmd.exe directly might bring better experience in some cases.
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1141 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 18:44 · PVG 02:44 · LAX 10:44 · JFK 13:44
Developed with CodeLauncher
♥ Do have faith in what you're doing.