mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
fix: add utf8 encoder for outputter
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
|
||||
"github.com/gocarina/gocsv"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"golang.org/x/text/encoding/unicode"
|
||||
"golang.org/x/text/transform"
|
||||
)
|
||||
|
||||
type OutPutter struct {
|
||||
@@ -35,7 +37,7 @@ func (o *OutPutter) Write(data Source, writer io.Writer) error {
|
||||
return encoder.Encode(data)
|
||||
default:
|
||||
gocsv.SetCSVWriter(func(w io.Writer) *gocsv.SafeCSVWriter {
|
||||
writer := csv.NewWriter(w)
|
||||
writer := csv.NewWriter(transform.NewWriter(w, unicode.UTF8BOM.NewEncoder()))
|
||||
writer.Comma = ','
|
||||
return gocsv.NewSafeCSVWriter(writer)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user