readline-sync/lib/decodedos.js

11 lines
279 B
JavaScript
Raw Normal View History

2015-03-11 09:06:27 +01:00
process.stdout.write(decodeDOS(process.argv[2] /*text*/ || ''),
process.env.RLS_ENCODING || 'binary', function() {
process.exit(0);
});
function decodeDOS(arg) {
return arg.replace(/#(\d+);/g, function(str, charCode) {
return String.fromCharCode(+charCode);
});
}