From 940abce87e97404bb80b573fd4f1022150678dc2 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Sat, 16 Feb 2008 09:00:26 +0100 Subject: Add HsLocale to support utf8 darcs-hash:20080216080026-d6583-444cd3a114db108b18002979902ccd55381c53be.gz --- HsLocale.hsc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 HsLocale.hsc 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 +foreign import ccall unsafe "locale.h setlocale" + setlocale :: CInt -> CString -> IO CString + +setupLocale :: IO () +setupLocale = withCString "" $ \s -> do + setlocale (#const LC_ALL) s + return () -- cgit v1.2.3