GeezerVison is showing github.com — doc: document fs.write limitation with TTY · nodejs/node@cfd5773
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/fs.md +8Lines changed: 8 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3501,6 +3501,13 @@ On Linux, positional writes don't work when the file is opened in append mode. |
3501 | 3501 | The kernel ignores the position argument and always appends the data to |
3502 | 3502 | the end of the file. |
3503 | 3503 |
|
| 3504 | +On Windows, if the file descriptor is connected to the console (e.g. `fd == 1` |
| 3505 | +or `stdout`) a string containing non-ASCII characters will not be rendered |
| 3506 | +properly by default, regardless of the encoding used. |
| 3507 | +It is possible to configure the console to render UTF-8 properly by changing the |
| 3508 | +active codepage with the `chcp 65001` command. See the [chcp][] docs for more |
| 3509 | +details. |
| 3510 | + |
3504 | 3511 | ## fs.writeFile(file, data[, options], callback) |
3505 | 3512 | <!-- YAML |
3506 | 3513 | added: v0.1.29 |
@@ -4899,3 +4906,4 @@ the file contents. |
4899 | 4906 | [Writable Stream]: stream.html#stream_class_stream_writable |
4900 | 4907 | [inode]: https://en.wikipedia.org/wiki/Inode |
4901 | 4908 | [support of file system `flags`]: #fs_file_system_flags |
| 4909 | +[chcp]: https://ss64.com/nt/chcp.html |