(svn r25676) -Fix: [Win32] The ANSI code page is not UTF-8 for non-Unicode builds.

This commit is contained in:
michi_cc
2013-08-05 20:36:55 +00:00
parent 63332afcf0
commit 765e7d349e
4 changed files with 42 additions and 91 deletions

View File

@@ -23,21 +23,14 @@ TCHAR *convert_to_fs(const char *name, TCHAR *utf16_buf, size_t buflen, bool con
/* Function shortcuts for UTF-8 <> UNICODE conversion. When unicode is not
* defined these macros return the string passed to them, with UNICODE
* they return a pointer to the converted string. The only difference between
* XX_TO_YY and XX_TO_YY_BUFFER is that with the buffer variant you can
* specify where to put the converted string (and how long it can be). Without
* the buffer and internal buffer is used, of max 512 characters */
* they return a pointer to the converted string. These functions use an
* internal buffer of max 512 characters. */
#if defined(UNICODE)
# define MB_TO_WIDE(str) OTTD2FS(str)
# define MB_TO_WIDE_BUFFER(str, buffer, buflen) convert_to_fs(str, buffer, buflen)
# define WIDE_TO_MB(str) FS2OTTD(str)
# define WIDE_TO_MB_BUFFER(str, buffer, buflen) convert_from_fs(str, buffer, buflen)
#else
extern uint _codepage; // local code-page in the system @see win32_v.cpp:WM_INPUTLANGCHANGE
# define MB_TO_WIDE(str) (str)
# define MB_TO_WIDE_BUFFER(str, buffer, buflen) (str)
# define WIDE_TO_MB(str) (str)
# define WIDE_TO_MB_BUFFER(str, buffer, buflen) (str)
#endif
HRESULT OTTDSHGetFolderPath(HWND, int, HANDLE, DWORD, LPTSTR);