Export CSV file golang problem of Chinese garbled

DSTF, ERR: = os.Create ( "./ Data /" + fileName) 
the defer dstf.Close () 
! = nil {IF ERR 
    beego.Error ( "Create File error:" + err.Error ()) 
    return "" , ERR 
} 
 
dstf.WriteString ( "\ xEF \ xBB \ xBF") // write UTF-8 BOM, Chinese prevent distortion 
// write data to a file 
w: = csv.NewWriter (dstf)

  

Guess you like

Origin www.cnblogs.com/tl542475736/p/12522589.html