Skip to content

Instantly share code, notes, and snippets.

@vsemozhetbyt
Created January 16, 2016 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsemozhetbyt/2a470efb0a284c5ed891 to your computer and use it in GitHub Desktop.
Save vsemozhetbyt/2a470efb0a284c5ed891 to your computer and use it in GitHub Desktop.
'use strict';
const path = process.argv[2];
if (!path) {
console.log('Add the file path, please.');
process.exit();
}
const fs = require('fs');
fs.createReadStream(path, {encoding: 'utf8'})
.pipe(fs.createWriteStream(path.replace(/(\.[^.]+)?$/, '.utf16$1'), {encoding: 'utf16le'}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment