PhantomJS arguments.js示例UTF-8不工作 [英] PhantomJS arguments.js example UTF-8 not working

查看:183
本文介绍了PhantomJS arguments.js示例UTF-8不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:这可能与我已经问过的问题有关: Highcharts导出服务器特殊字符替换为问号。



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 ),我的问题已经消失。



以下是如何设置一个干净的UTF-8环境在Linux中安装


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 of en_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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆