summaryrefslogtreecommitdiffhomepage
path: root/HsLocale.hsc
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2008-02-16 09:00:26 +0100
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2008-02-16 09:00:26 +0100
commit940abce87e97404bb80b573fd4f1022150678dc2 (patch)
tree8e957b11935d4014e59d9227f5793070dd9435ae /HsLocale.hsc
parent814e41cf2675fa9d4efa50c220f060db7a78eaec (diff)
downloadxmobar-940abce87e97404bb80b573fd4f1022150678dc2.tar.gz
xmobar-940abce87e97404bb80b573fd4f1022150678dc2.tar.bz2
Add HsLocale to support utf8
darcs-hash:20080216080026-d6583-444cd3a114db108b18002979902ccd55381c53be.gz
Diffstat (limited to 'HsLocale.hsc')
-rw-r--r--HsLocale.hsc27
1 files changed, 27 insertions, 0 deletions
diff --git a/HsLocale.hsc b/HsLocale.hsc
new file mode 100644
index 0000000..a54ff34
--- /dev/null
+++ b/HsLocale.hsc
@@ -0,0 +1,27 @@
+{-# OPTIONS -fglasgow-exts #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module : HsLocale
+-- Copyright : (C) 2007 Andrea Rossato
+-- License : BSD3
+--
+-- Maintainer : andrea.rossato@unibz.it
+-- Stability : unstable
+-- Portability : unportable
+--
+-----------------------------------------------------------------------------
+
+module HsLocale
+ ( setupLocale
+ ) where
+
+import Foreign.C
+
+#include <locale.h>
+foreign import ccall unsafe "locale.h setlocale"
+ setlocale :: CInt -> CString -> IO CString
+
+setupLocale :: IO ()
+setupLocale = withCString "" $ \s -> do
+ setlocale (#const LC_ALL) s
+ return ()