PhantomJS arguments.js example UTF-8 not working

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 08:43:29

问题


NOTE : This might be related to the question I already asked Highcharts export server special characters replaced with question mark.

The PhantomJS arguments.js example returns the parameters you give.

Example :

phantomjs arguments.js a b c

Returns :

0: arguments.js
1: a
2: b
3: c

On Mac OS X with PhantomJS 1.9.0 installed, I have no problem returning arguments with special characters. But on the remote server I'm working with (Linux Debian 6), it does not work as expected :

phantomjs arguments.js à é €

Which returns (as expected) the following on Mac OS X :

0: arguments.js
1: à
2: é
3: €

What I get on Linux Debian 6:

0: arguments.js
1: à
2: é
3: â

I have checked PhantomJS requirements and FreeType and Fontconfig are installed.


回答1:


I've just had to configure the default encoding of the terminal (in my case en_US.UTF-8 instead of en_US) and my problem was gone.

Here is How to set up a clean UTF-8 environment in Linux.



来源:https://stackoverflow.com/questions/17367755/phantomjs-arguments-js-example-utf-8-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!