projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Call nl_langinfo(CODESET) to get the name of the locale encoding on Unix
[ghc-base.git]
/
cbits
/
PrelIOUtils.c
diff --git
a/cbits/PrelIOUtils.c
b/cbits/PrelIOUtils.c
index
de7fed4
..
6444bd0
100644
(file)
--- a/
cbits/PrelIOUtils.c
+++ b/
cbits/PrelIOUtils.c
@@
-24,4
+24,14
@@
void debugBelch2(const char*s, char *t)
{
debugBelch(s,t);
}
+
+// Use a C wrapper for this because we avoid hsc2hs in base
+#if HAVE_LANGINFO_H
+#include <langinfo.h>
+char *localeEncoding (void)
+{
+ return nl_langinfo(CODESET);
+}
+#endif
+
#endif /* __GLASGOW_HASKELL__ */