From b5a0918160f7dfabeb2b4e9971f71df9c2a0685e Mon Sep 17 00:00:00 2001 From: Donovan Jimenez Date: Wed, 5 Feb 2014 14:33:59 -0500 Subject: [PATCH] issue #11: calling setlocale at init for TRANSLIT --- converter.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/converter.go b/converter.go index 2a40706..d0fc04f 100644 --- a/converter.go +++ b/converter.go @@ -6,11 +6,21 @@ package iconv #cgo windows LDFLAGS: -liconv #include #include +#include + +// called by init, seems to be necessary for TRANSLIT to work +void initLocale() { + setlocale(LC_ALL, ""); +} */ import "C" import "syscall" import "unsafe" +func init() { + C.initLocale() +} + type Converter struct { context C.iconv_t open bool