質問するログイン新規登録

回答編集履歴

2

m

2021/05/08 00:40

投稿

yumetodo
yumetodo

スコア5852

answer CHANGED
@@ -4,4 +4,10 @@
4
4
  ucrt側のバグという可能性。せめてこの報告されてるissueをupvoteしておきますか・・・
5
5
 
6
6
  > [https://github.com/microsoft/terminal/issues/4551#issuecomment-585487802](https://github.com/microsoft/terminal/issues/4551#issuecomment-585487802)
7
- > ReadFile and ReadConsoleA are currently limited to 7-bit ASCII when the input codepage is UTF-8 (65001) due to an assumption of 1 CHAR per WCHAR when calling WideCharToMultiByte.
7
+ > ReadFile and ReadConsoleA are currently limited to 7-bit ASCII when the input codepage is UTF-8 (65001) due to an assumption of 1 CHAR per WCHAR when calling WideCharToMultiByte.
8
+
9
+ ---
10
+
11
+ いやまてよ、そもそもこのバグが治ったとして、どうせ内部でUTF-16->UTF-8変換が挟まるなら、ユーザーランドでやっても変わらなくないか?となるとネタで昔作った
12
+ [https://github.com/yumetodo/utf8_streambuf](https://github.com/yumetodo/utf8_streambuf)
13
+ がまさかの出番という可能性・・・。

1

2021/05/08 00:40

投稿

yumetodo
yumetodo

スコア5852

answer CHANGED
@@ -1,7 +1,7 @@
1
1
  うーん、
2
2
  [https://developercommunity.visualstudio.com/t/-read-cannot-read-utf-8-but-cgets-s-can/910961](https://developercommunity.visualstudio.com/t/-read-cannot-read-utf-8-but-cgets-s-can/910961)
3
3
  にあるように、ReadConsoleW のラッパーたる_cgets_sを使うのがワークアラウンドっぽい?
4
- ucrt側のバグという可能性。
4
+ ucrt側のバグという可能性。せめてこの報告されてるissueをupvoteしておきますか・・・
5
5
 
6
6
  > [https://github.com/microsoft/terminal/issues/4551#issuecomment-585487802](https://github.com/microsoft/terminal/issues/4551#issuecomment-585487802)
7
7
  > ReadFile and ReadConsoleA are currently limited to 7-bit ASCII when the input codepage is UTF-8 (65001) due to an assumption of 1 CHAR per WCHAR when calling WideCharToMultiByte.