Go only has support for UTF-8, so you need to convert the file.

e.g.

package main

import (
    "fmt"

    "golang.org/x/text/encoding/simplifiedchinese"
)

func main() {
    gbk := simplifiedchinese.GBK.NewDecoder()
    s, err := gbk.String("a\xfe\xfeb")

    if err != nil {
        panic(err)
    }

    fmt.Println(s)
}


On Thursday, 3 May 2018 16:12:28 UTC+8, Able Gao wrote:
>
> I want to call a DDL file in windows XP or 7 32bit system, and the DDL 
> file was encoded by GBK. Is there any expert knows what is the best 
> solution to call this GBK encoded DDL file by GO? In GCC, i can use gcc 
> -finput-charset=GBK -fexec-charset=GBK 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to