根据您在数据库中的字符类型,我猜这可能是控制台限制。如果您chcp
在控制台中键入,您将看到活动代码页是什么,它可能类似于CP437 ,也称为扩展 ASCII。如果此代码页中有字符,例如 UTF8,您可能会遇到问题。chcp 65001
您可以通过键入切换到 UTF8来更改当前活动的代码页。
您可能还想根据所需的字符将默认 Raster 字体更改为 Lucida Console,因为并非所有字体都支持扩展字符(右键单击命令提示符窗口的标题、属性、字体)。
As already said, PHP's unicode support is not ideal, but you can manage to do it in PHP5 with a few well placed function call of utf8_decode. The secret of character encoding is to understand well what is the current encoding of all the tools you are using: database, database connection, current bytes in your PHP variable, your output to the console screen, your email's body encoding, your email client, and so on...
For everything that have special characters, in our modern days, something like UTF8 is often recommended. Make sure everything along the way is set to UTF8 and convert only where necessary.