PhantomJS arguments.js示例UTF-8不工作 [英] PhantomJS arguments.js example UTF-8 not working
问题描述
PhantomJS arguments.js
示例返回您提供的参数。
示例:
phantomjs arguments.js abc
/ pre>
返回:
0:arguments.js
1:a
2:b
3:c
在Mac OS X与PhantomJS 1.9.0安装,我没有问题返回参数与特殊字符。但是在远程服务器上,我正在使用(Linux Debian 6),它不按预期方式工作:
phantomjs参数。哪些在Mac OS X上返回(如预期的)以下内容: p $ p
0:arguments.js
1:à
2:é
3:€
在Linux上Debian 6:
0:arguments.js
1:Ã
2:é
3:â
我检查过 PhantomJS要求,FreeType和Fontconfig是
解决方案我只需要配置终端的默认编码(在我的情况下
en_US.UTF-8
而不是en_US
),我的问题已经消失。
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.
解决方案I've just had to configure the default encoding of the terminal (in my case
en_US.UTF-8
instead ofen_US
) and my problem was gone.Here is How to set up a clean UTF-8 environment in Linux.
这篇关于PhantomJS arguments.js示例UTF-8不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!