(svn r7274) -Codechange [utf8]: Add input/output unicode support. This actually only changes win32

since it uses UTF16 for file access. To keep os-specific code to a minimum, OpenTTD
 uses UTF8 internally everywhere, converting to OS-type when needed (save/load/screenshot/etc.)
This commit is contained in:
Darkvater
2006-11-28 14:42:31 +00:00
parent 9253387001
commit 4e71091137
10 changed files with 89 additions and 37 deletions

View File

@@ -154,6 +154,19 @@
# include <stddef.h>
#endif /* defined(_MSC_VER) */
/* NOTE: the string returned by these functions is only valid until the next
* call to the same function and is not thread- or reentrancy-safe */
#if !defined(STRGEN)
# if defined(WIN32) || defined(WIN64)
# define fopen(file, mode) _wfopen(OTTD2FS(file), L ## mode)
const char *FS2OTTD(const wchar_t *name);
const wchar_t *OTTD2FS(const char *name);
# else
# define fopen(file, mode) fopen(OTTD2FS(file), mode)
const char *FS2OTTD(const char *name);
const char *OTTD2FS(const char *name);
# endif /* WIN32 */
#endif /* STRGEN */
// Windows has always LITTLE_ENDIAN
#if defined(WIN32) || defined(__OS2__) || defined(WIN64)