diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-08-15 09:32:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-15 09:32:18 +0200 |
commit | 6261d2658fdff93a732b02d8fd6e386245968f2d (patch) | |
tree | 3dd5de174ff4b0b555a49cff30937a2304b71857 /src/nvim/message.c | |
parent | eb9f3308bc329c212009820817d35c6ab7a88117 (diff) | |
parent | 975be7e5dcf6a2ee59a6fc236e75b434b6ce4423 (diff) | |
download | rneovim-6261d2658fdff93a732b02d8fd6e386245968f2d.tar.gz rneovim-6261d2658fdff93a732b02d8fd6e386245968f2d.tar.bz2 rneovim-6261d2658fdff93a732b02d8fd6e386245968f2d.zip |
Merge #10761 from justinmk/win-utf-libuv-align
utf8_to_utf16, utf16_to_utf8: align with libuv
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r-- | src/nvim/message.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index b043df17d3..6e935022ca 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -2559,10 +2559,11 @@ static int do_more_prompt(int typed_char) #if defined(WIN32) void mch_errmsg(char *str) { + assert(str != NULL); wchar_t *utf16str; - int conversion_result = utf8_to_utf16((str), &utf16str); - if (conversion_result != 0) { - EMSG2("utf8_to_utf16 failed: %d", conversion_result); + int r = utf8_to_utf16(str, -1, &utf16str); + if (r != 0) { + fprintf(stderr, "utf8_to_utf16 failed: %d", r); } else { fwprintf(stderr, L"%ls", utf16str); xfree(utf16str); @@ -2572,10 +2573,11 @@ void mch_errmsg(char *str) // Give a message. To be used when the UI is not initialized yet. void mch_msg(char *str) { + assert(str != NULL); wchar_t *utf16str; - int conversion_result = utf8_to_utf16((str), &utf16str); - if (conversion_result != 0) { - EMSG2("utf8_to_utf16 failed: %d", conversion_result); + int r = utf8_to_utf16(str, -1, &utf16str); + if (r != 0) { + fprintf(stderr, "utf8_to_utf16 failed: %d", r); } else { wprintf(L"%ls", utf16str); xfree(utf16str); |