From 3db07ff5cb4a4712d4e43635c1591c3d9a18ef33 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 22 Nov 2018 17:36:17 +0100 Subject: [PATCH 1/3] doc: document fs.write limitation with TTY Fixes: https://github.com/nodejs/node/issues/24550 --- doc/api/fs.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index e73fd1ad26ed27..0f5e88fbc8aaa6 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3528,6 +3528,13 @@ On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file. +On Windows, if the file descriptor is connected to the console (e.g. `fd == 1` +or `stdout`) a string encoded as UTF-8 or Unicode (`ucs2`) will not be rendered +properly by default. +It is possible to configure the console to render UTF-8 properly by changing the +active codepage with the `chcp 65001` command. See the [chcp][] docs for more +details. + ## fs.writeFile(file, data[, options], callback)