diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2018-11-02 01:04:39 +0900 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-11-05 09:58:29 +0100 |
commit | 5bfaa86ceb3c2a9ac474a928e748c4a86a703b33 (patch) | |
tree | 7cc3a467361129b102064657bea7403c736b91f2 /src/tool_main.c | |
parent | 29c05ce9c36dda4ee595b2606015cfb5222b0e39 (diff) | |
download | curl-5bfaa86ceb3c2a9ac474a928e748c4a86a703b33.tar.gz |
curl: fixed UTF-8 in current console code page (Windows)
Fixes #3211
Fixes #3175
Closes #3212
Diffstat (limited to 'src/tool_main.c')
-rw-r--r-- | src/tool_main.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/tool_main.c b/src/tool_main.c index 612bfcb6a..6dc74d923 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -241,13 +241,12 @@ static void main_free(struct GlobalConfig *config) static struct TerminalSettings { HANDLE hStdOut; DWORD dwOutputMode; - UINT nCodepage; } TerminalSettings; static void configure_terminal(void) { /* - * If we're running Windows, enable VT output & set codepage to UTF-8. + * If we're running Windows, enable VT output. * Note: VT mode flag can be set on any version of Windows, but VT * processing only performed on Win10 >= Creators Update) */ @@ -257,10 +256,7 @@ static void configure_terminal(void) #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif - /* Cache current codepage (will restore on exit) & set codepage to UTF-8 */ memset(&TerminalSettings, 0, sizeof(TerminalSettings)); - TerminalSettings.nCodepage = GetConsoleOutputCP(); - SetConsoleOutputCP(65001); /* Enable VT output */ TerminalSettings.hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); @@ -282,7 +278,6 @@ static void restore_terminal(void) /* Restore Console output mode and codepage to whatever they were * when Curl started */ SetConsoleMode(TerminalSettings.hStdOut, TerminalSettings.dwOutputMode); - SetConsoleOutputCP(TerminalSettings.nCodepage); #endif } |