0

問題は、MinGW でコンパイルされたプログラムには、wcout を介してコンソールに非 ASCII 文字を出力する際に​​問題があり、出力に異なるコードページの文字が表示されるか、完全に空白になる可能性があることです。しかし、winapiWriteConsoleWは完璧に動作します。したがって、 << 演算子の動作を変更して winapi メソッドを呼び出さないようにする可能性があるかどうかを尋ねます。

(私はそれを行う方法の例を見つけられませんでした。私はc ++を初めて使用します。オブジェクトをオーバーロードする方法の例はたくさんありますが、文字列またはワイド文字配列でそれを行う方法はありません。)

4

1 に答える 1

2

You can create a suitable stream buffer sending characters wherever you need to send them. You can use rdbuf() to set the stream buffer used by std::wcout. I don't think I have provided an example using wchar_t as character type in the past but it would work just as the plenty examples for char.

于 2012-12-15T18:29:10.593 に答える