-
Notifications
You must be signed in to change notification settings - Fork 285
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
utf-8 to gbk is error #78
Comments
now I use this way to solve: |
Could you post:
|
Although I probably know what the problem is. The file you read has a BOM character in the beginning. Unfortunately, Node.js keeps it by default (see nodejs/node-v0.x-archive#1918). Then, GBK encoding has no code for the BOM character, so iconv-lite replaces it by '?'. Solutions:
Let me know if it helps. |
"version": "0.4.4","GBK encoding has no code for the BOM character"; |
fs.readFile(path,{encoding:'utf-8'},function(err,data){
buf = iconv.encode(data,'gbk');
fs.writeFile(outName,buf,function(){
callback();
});
});
input: var s = 1;
ouput : ?var s = 1;
A '?' is always there.
The text was updated successfully, but these errors were encountered: