running gofmt on sources, and removing iconv LDFLAG on linux
This commit is contained in:
parent
76220410e9
commit
c6169bab90
@ -3,7 +3,6 @@ package iconv
|
|||||||
/*
|
/*
|
||||||
#cgo darwin LDFLAGS: -liconv
|
#cgo darwin LDFLAGS: -liconv
|
||||||
#cgo freebsd LDFLAGS: -liconv
|
#cgo freebsd LDFLAGS: -liconv
|
||||||
#cgo linux LDFLAGS: -liconv
|
|
||||||
#cgo windows LDFLAGS: -liconv
|
#cgo windows LDFLAGS: -liconv
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
|
@ -2,9 +2,9 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"io/ioutil"
|
|
||||||
"iconv"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"iconv"
|
||||||
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ func main() {
|
|||||||
// read bytes from sample.utf8
|
// read bytes from sample.utf8
|
||||||
utf8Bytes, err := ioutil.ReadFile("sample.utf8")
|
utf8Bytes, err := ioutil.ReadFile("sample.utf8")
|
||||||
|
|
||||||
if (err != nil) {
|
if err != nil {
|
||||||
fmt.Println("Could not open 'sample.utf8': ", err)
|
fmt.Println("Could not open 'sample.utf8': ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// test iconv.Reader
|
// test iconv.Reader
|
||||||
utf8File,_ := os.Open("sample.utf8", os.O_RDONLY, 0)
|
utf8File, _ := os.Open("sample.utf8")
|
||||||
utf8Reader, _ := iconv.NewReader(utf8File, "utf-8", "ebcdic-us")
|
utf8Reader, _ := iconv.NewReader(utf8File, "utf-8", "ebcdic-us")
|
||||||
bytesRead, err = utf8Reader.Read(testBuffer)
|
bytesRead, err = utf8Reader.Read(testBuffer)
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ func main() {
|
|||||||
fmt.Println("utf8 was property converted to ebcdic-us by iconv.Reader")
|
fmt.Println("utf8 was property converted to ebcdic-us by iconv.Reader")
|
||||||
}
|
}
|
||||||
|
|
||||||
ebcdicFile,_ := os.Open("sample.ebcdic-us", os.O_RDONLY, 0)
|
ebcdicFile, _ := os.Open("sample.ebcdic-us")
|
||||||
ebcdicReader, _ := iconv.NewReader(ebcdicFile, "ebcdic-us", "utf-8")
|
ebcdicReader, _ := iconv.NewReader(ebcdicFile, "ebcdic-us", "utf-8")
|
||||||
bytesRead, err = ebcdicReader.Read(testBuffer)
|
bytesRead, err = ebcdicReader.Read(testBuffer)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user