Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utf8检测失败 #2

Closed
hiwanz opened this issue Sep 22, 2014 · 2 comments
Closed

utf8检测失败 #2

hiwanz opened this issue Sep 22, 2014 · 2 comments

Comments

@hiwanz
Copy link

hiwanz commented Sep 22, 2014

用sublimetext3保存为utf8文件,检测失败

var fs = require('fs');
var isUtf8 = require('is-utf8');

var utf8 = fs.readFileSync('test.html');

console.log('test.html is utf8: '+isUtf8(utf8));

@hiwanz hiwanz changed the title detect utf8 failed utf8检测失败 Sep 22, 2014
@wayfind
Copy link
Owner

wayfind commented Dec 19, 2015

是不是文件字节不够大。至少要有两个汉字。

@wayfind wayfind closed this as completed Dec 19, 2015
@hiwanz
Copy link
Author

hiwanz commented Dec 25, 2015

抱歉,问题太久了,整理gist的时候被我删掉了,最近又遇到了一次打包demo上来

node test.js
utf8.js is utf8: false

utf8-test.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants