Created
March 25, 2011 15:17
-
-
Save shinout/886998 to your computer and use it in GitHub Desktop.
iconv -f euc-jp -t utf-8 filename
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spawn = require('child_process').spawn, | |
iconv = spawn('iconv', ['-f', 'euc-jp', '-t', 'utf-8']), | |
fs = require('fs'); | |
var filename = __dirname + '/eucjp.html'; | |
var stream = fs.createReadStream(filename); | |
stream.pipe(iconv.stdin); | |
iconv.stdout.on('data', function(data) { | |
process.stdout.write(data.toString()); | |
}); | |
iconv.stdout.on('error', function(e) { | |
console.log("err"); | |
process.stderr.write(e); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment