V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  hho2002  ›  全部回复第 1 页 / 共 1 页
回复总数  2
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   ·   实用小工具   ·   902 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 20:07 · PVG 04:07 · LAX 12:07 · JFK 15:07
Developed with CodeLauncher
♥ Do have faith in what you're doing.