cdffd322bb
ok jasper@ (who also gave an ok to all the depending updates).
42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
$OpenBSD: patch-libraries_base_cbits_PrelIOUtils_c,v 1.2 2011/04/11 14:30:33 kili Exp $
|
|
|
|
We have very limited locale support so used latin1 as default codeset
|
|
which can be overridden by the environment variable `HS_ENCODING'.
|
|
|
|
--- libraries/base/cbits/PrelIOUtils.c.orig Sun Dec 19 13:14:39 2010
|
|
+++ libraries/base/cbits/PrelIOUtils.c Sun Dec 19 13:18:39 2010
|
|
@@ -24,28 +24,14 @@ void debugBelch2(const char*s, char *t)
|
|
debugBelch(s,t);
|
|
}
|
|
|
|
-#if defined(HAVE_LIBCHARSET)
|
|
-# include <libcharset.h>
|
|
-#elif defined(HAVE_LANGINFO_H)
|
|
-# include <langinfo.h>
|
|
-#endif
|
|
-
|
|
#if !defined(mingw32_HOST_OS)
|
|
+#include <stdlib.h>
|
|
+#include <string.h>
|
|
const char* localeEncoding(void)
|
|
{
|
|
-#if defined(HAVE_LIBCHARSET)
|
|
- return locale_charset();
|
|
-
|
|
-#elif defined(HAVE_LANGINFO_H)
|
|
- return nl_langinfo(CODESET);
|
|
-
|
|
-#else
|
|
-#warning Depending on the unportable behavior of GNU iconv due to absence of both libcharset and langinfo.h
|
|
- /* GNU iconv accepts "" to mean the current locale's
|
|
- * encoding. Warning: This isn't portable.
|
|
- */
|
|
- return "";
|
|
-#endif
|
|
+ char *l;
|
|
+ l = getenv("HS_ENCODING");
|
|
+ return l != NULL ? l : "latin1";
|
|
}
|
|
#endif
|
|
|