aboutsummaryrefslogtreecommitdiff
path: root/examples/main
diff options
context:
space:
mode:
Diffstat (limited to 'examples/main')
-rw-r--r--examples/main/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 67a34e6..d59eeb4 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -386,10 +386,19 @@ int main(int argc, char ** argv) {
std::string line;
bool another_line = true;
do {
+#if defined(_WIN32)
+ std::wstring wline;
+ if (!std::getline(std::wcin, wline)) {
+ // input stream is bad or EOF received
+ return 0;
+ }
+ win32_utf8_encode(wline, line);
+#else
if (!std::getline(std::cin, line)) {
// input stream is bad or EOF received
return 0;
}
+#endif
if (line.empty() || line.back() != '\\') {
another_line = false;
} else {