English 中文(简体)
Java 核心bor缩体——特性编码问题
原标题:JavaScriptCore borked strings – character encoding issue

我试图利用JavaCalleore从终点站进行一些操纵,但我可以不住过去某种性质的问题。

如果我是在站楼:

/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc -e "print( héllo world )"

它显然应当印刷<代码>héllo World,但应当印刷hÃllo world。 如果我以jsc互动方式作书面发言,结果也是一样的。

我知道,单人的文本是个不正确的特性,令人不安。 事实是,我可以指出,如何告诉 j笑使用某种特定编码。 我曾尝试改变换面汇率,但无效果。

在什么地方出现令人信服的问题,以及我如何解决这一问题?

最佳回答

与JavascriptCode一样,似乎不支持UTF8输入档案(此处是终点站)。

请注意,<代码>node.js的确正确处理你的例子。

In your simple case, it may be possible to use the slightly extended 8 bit character set CP1252. I.e., if you put the above print command in a file a.txt and use iconv to convert it:

iconv -f utf-8 -t CP1252 a.txt >aa.txt

您现在可以操作jsc aa.txt,并取得预期产出(héllo world)。

另一种(不方便的)选择是直接使用统法协会编码点。 您的榜样就是这样:

print( hu00E9llo world );
问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签