在编写node.js中的控制台时编码问题 [英] Encoding problems when writing to the console in node.js

查看:129
本文介绍了在编写node.js中的控制台时编码问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在node.js中的编码问题。我在Windows上运行它,例如,如果我运行这个简单的程序:

I'm having problems with the encoding in node.js. I'm running it on windows and for example if I run this simple program:

console.log("trying áéíóú");

我进入控制台:


尝试

trying ?????

这是正常吗?如何解决这个问题?

Is this normal? How can I solve this problem?

谢谢

推荐答案

是您的控制台无法按照当前配置的方式处理某些字符。检查设置,看看是否可以启用不同的字符集。你可能想使用Unicode。

The problem is that your console is not capable of handling certain characters the way it is currently configured. Check in the settings and see if you can enable different character sets. You probably want to use Unicode.

这篇关于在编写node.js中的控制台时编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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