我们正在处理一个以前从未发生过的Joyent Solaris服务器中的奇怪错误(不会发生在localhost或其他两个具有相同php配置的Solaris服务器上).实际上,我不确定我们是否必须查看php或solaris,以及它是否是软件或硬件问题......
我只是想发布这个,以防有人指出我们正确的方向.
所以,问题似乎是在var_export()处理奇怪的角色时.在CLI中执行此操作,我们在localhost机器和两个服务器中获得预期结果,但不在第三个服务器中获得.所有这些都配置为使用utf-8.
$ php -r "echo var_export('ñu', true);"
在旧服务器和localhost (预期)中给出:
'ñu'
但是在服务器中我们遇到了问题(PHP版本=> 5.3.6),\0每当遇到"不常见"的字符时它会添加空字符:è,á,ç,......你给它命名.
'' . "\0" . '' . "\0" . 'u'
关于应该在哪里看的任何想法?提前致谢.
更多信息:
PHP version 5.3.6.setlocale() 没有解决任何问题.default_charset是UTF-8在php.ini.mbstring.internal_encoding被设置为UTF-8在php.ini.mbstring.func_overload = 0.iconv 编码也是 UTF-8utf-8编码.system('locale') 收益:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=
到目前为止完成的一些测试(CLI):
正常行为:
$ php …任何人都知道这是什么以及如何解决它?"OMG"
<p>After 32 years in its former location, this popular restaurant 
   and bar moved to the bottom of the Avalon Bay Luxury residential building 
   that's just a walk from Angel Stadium. Modern and welcoming, the expansive 
   space is where fans, locals and families gather for upscale twists on classic
   American dishes. Burgers here have a decidedly fun flair like “The OMG� 
   that is a burger surely meant for sharing (with many)--it's so huge that it's 
   served on a 14-inch bun. …