diff --git a/system_encoding.c b/system_encoding.c index d9bf42f..b3b4d25 100644 --- a/system_encoding.c +++ b/system_encoding.c @@ -1,9 +1,6 @@ #include "system_encoding.h" char* get_system_encoding() { -#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) - return nl_langinfo(CODESET); -#else - return "ASCII"; -#endif + setlocale(LC_ALL,""); + return nl_langinfo(CODESET); } diff --git a/system_encoding.h b/system_encoding.h index 63cf6b1..c64015a 100644 --- a/system_encoding.h +++ b/system_encoding.h @@ -1,9 +1,8 @@ #ifndef __SYSTEM_ENCODING__ #define __SYSTEM_ENCODING__ -#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) #include -#endif +#include char* get_system_encoding();