diff --git a/src/filesystem/implementation.js b/src/filesystem/implementation.js index 3027688..90fbd22 100644 --- a/src/filesystem/implementation.js +++ b/src/filesystem/implementation.js @@ -1873,7 +1873,7 @@ function writeFile(context, path, data, options, callback) { if(typeof data === 'number') { data = '' + data; } - if(typeof data === 'string' && options.encoding === 'utf8') { + if(typeof data === 'string' && (options.encoding || 'utf8') === 'utf8') { data = Buffer.from(data); }