PhantomJS arguments.js example UTF-8 not working

2019-07-31 14:18发布

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条回答
来,给爷笑一个
2楼-- · 2019-07-31 14:48

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.

查看更多
登录 后发表回答