Improve Unicode handling when writing to an ostream on Windows (#2994)
* Refactor detail::print() by splitting into two functions.
The part with SetConsoleW is a separate function, without fwrite().
* Make Unicode handing when writing to std::ostream more robust.
Calls to print(ostream&) in the special Unicode case on Windows fallback
to writing via ostream::write instead of fwrite().
* Fix Unicode handling when writing to an ostream on GCC on Windows
* Add TODO note about detail::is_utf8()
* Fix warning -Wundef
* Fix for non-Windows OSs
* Fix building as DLL on Windows
* Refactor
* Suppress warning
3 files changed