about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2019-02-07 13:57:41 +0800
committerGitHub <noreply@github.com>2019-02-07 13:57:41 +0800
commit2be3ca4427d5b843fe7df6a55dc340a7aa9516c3 (patch)
tree00b36a5bb5ad97a3144f945d26dd60519e997af2 /src/libstd/sys
parent262b241e1652e8c07442fff261e4701e3871442f (diff)
parent27c8dfddac4c69a6fd399abe537e1007306c58cf (diff)
downloadrust-2be3ca4427d5b843fe7df6a55dc340a7aa9516c3.tar.gz
rust-2be3ca4427d5b843fe7df6a55dc340a7aa9516c3.zip
Rollup merge of #58136 - abonander:doc-win-stdio-unicode, r=dtolnay
Improve error message and docs for non-UTF-8 bytes in stdio on Windows

This should make debugging problems like abonander/multipart#106 significantly more straightforward in the future.

cc #23344, @retep998 @alexcrichton

Not sure who do r? so I'll let rust-highfive pick one.
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/windows/stdio.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/sys/windows/stdio.rs b/src/libstd/sys/windows/stdio.rs
index a4f4bd22cd9..0ea19a85525 100644
--- a/src/libstd/sys/windows/stdio.rs
+++ b/src/libstd/sys/windows/stdio.rs
@@ -188,7 +188,9 @@ impl Output {
 }
 
 fn invalid_encoding() -> io::Error {
-    io::Error::new(io::ErrorKind::InvalidData, "text was not valid unicode")
+    io::Error::new(io::ErrorKind::InvalidData,
+                   "Windows stdio in console mode does not support non-UTF-8 byte sequences; \
+                    see https://github.com/rust-lang/rust/issues/23344")
 }
 
 fn readconsole_input_control(wakeup_mask: c::ULONG) -> c::CONSOLE_READCONSOLE_CONTROL {