win32_gui: encode copy-to-clipboard and save-to-file text in UTF-8

This commit is contained in:
Alex Kompel
2015-04-15 22:13:10 -07:00
parent 7c644c1507
commit c8679c8e0e
2 changed files with 31 additions and 22 deletions
+4 -3
View File
@@ -211,9 +211,10 @@ extern COLORREF message_fg_color;
#define SYSCLR_TO_BRUSH(x) ((HBRUSH)((x) + 1))
/* unicode stuff */
#ifdef UNICODE
#define NH_CODEPAGE (SYMHANDLING(H_IBM)?GetOEMCP():GetACP())
#ifdef _UNICODE
#define NH_W2A(w, a, cb) ( WideCharToMultiByte( \
CP_ACP, \
NH_CODEPAGE, \
0, \
(w), \
-1, \
@@ -223,7 +224,7 @@ extern COLORREF message_fg_color;
NULL), (a) )
#define NH_A2W(a, w, cb) ( MultiByteToWideChar( \
CP_ACP, \
NH_CODEPAGE, \
0, \
(a), \
-1, \