From f069504db0d83b1dfa7dc0e1eacdb14208a6be8a Mon Sep 17 00:00:00 2001 From: Henning Guenther Date: Mon, 13 Aug 2007 05:35:58 -0700 Subject: [PATCH] Work-around for windows-platforms getSystemEncoding will always return "ASCII" on windows. If you know a replacement for langinfo.h on windows, please tell me. darcs-hash:20070813123558-a4fee-ec2f0f39494b005f8ae30fa7f0c2862cfa77695d --- system_encoding.c | 4 ++++ system_encoding.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/system_encoding.c b/system_encoding.c index 96d4213..d9bf42f 100644 --- a/system_encoding.c +++ b/system_encoding.c @@ -1,5 +1,9 @@ #include "system_encoding.h" char* get_system_encoding() { +#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) return nl_langinfo(CODESET); +#else + return "ASCII"; +#endif } diff --git a/system_encoding.h b/system_encoding.h index 286a8aa..63cf6b1 100644 --- a/system_encoding.h +++ b/system_encoding.h @@ -1,7 +1,9 @@ #ifndef __SYSTEM_ENCODING__ #define __SYSTEM_ENCODING__ +#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) #include +#endif char* get_system_encoding();