issue #11: calling setlocale at init for TRANSLIT
This commit is contained in:
parent
5f6a5a4f00
commit
b5a0918160
10
converter.go
10
converter.go
@ -6,11 +6,21 @@ package iconv
|
|||||||
#cgo windows LDFLAGS: -liconv
|
#cgo windows LDFLAGS: -liconv
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
|
// called by init, seems to be necessary for TRANSLIT to work
|
||||||
|
void initLocale() {
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
import "syscall"
|
import "syscall"
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
C.initLocale()
|
||||||
|
}
|
||||||
|
|
||||||
type Converter struct {
|
type Converter struct {
|
||||||
context C.iconv_t
|
context C.iconv_t
|
||||||
open bool
|
open bool
|
||||||
|
Loading…
Reference in New Issue
Block a user