码迷,mamicode.com
首页 > Web开发 > 详细

sublime text3 nodejs控制台输出结果中文乱码

时间:2018-07-10 22:09:54      阅读:2002      评论:0      收藏:0      [点我收藏+]

标签:amp   select   osx   sublime   linux   nodejs   regex   shell   bin   

在sublime text3安装完nodejs的插件后,运行console.log("你好"),发现控制台出现中文乱码,解决办法:Preferences-> Browser Packages 打开文件夹后找到  Nodejs -> Nodejs.sublime-build

改其中的encoding为utf-8即可, 默认为cp1252 

 1 {
 2   "cmd": ["node", "$file"],
 3   "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
 4   "selector": "source.js",
 5   "shell": true,
 6   "encoding": "utf-8",
 7   "windows":
 8     {
 9         "shell_cmd": "taskkill /F /IM node.exe & node $file"
10     },
11     "linux":
12     {
13         "shell_cmd": "killall node; /usr/bin/env node $file"
14     },
15     "osx":
16     {
17         "shell_cmd": "killall node; /usr/bin/env node $file"
18     }
19 }

 

sublime text3 nodejs控制台输出结果中文乱码

标签:amp   select   osx   sublime   linux   nodejs   regex   shell   bin   

原文地址:https://www.cnblogs.com/clicklin/p/9291653.html

(0)
(2)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!