mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-18 18:22:07 +08:00
Use wcstombs when iconv is not present (#223)
Replace the jerry-built UTF-16 => Latin-1 code path with a cross-platform wcstombs solution that emits UTF-8. This adds an element to the end of the MdbHandle struct, but should not break any existing code. A run-time option could be added later to emit other encodings, but people who care about such things can just use the iconv code path.
This commit is contained in:
@@ -39,6 +39,11 @@
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#include <iconv.h>
|
||||
#else
|
||||
#ifdef HAVE_XLOCALE_H
|
||||
#include <xlocale.h>
|
||||
#endif
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -291,6 +296,10 @@ typedef struct {
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t iconv_in;
|
||||
iconv_t iconv_out;
|
||||
#elif defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || defined(WINDOWS)
|
||||
_locale_t locale;
|
||||
#else
|
||||
locale_t locale;
|
||||
#endif
|
||||
} MdbHandle;
|
||||
|
||||
|
Reference in New Issue
Block a user