forked from mirrors/tar-split
common: remove in favor of stdlib unicode/utf8
This commit is contained in:
parent
7ef16e6f67
commit
7e38cefd4b
5 changed files with 9 additions and 75 deletions
|
@ -6,8 +6,7 @@ import (
|
|||
"errors"
|
||||
"io"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/vbatts/tar-split/tar/common"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
// ErrDuplicatePath occurs when a tar archive has more than one entry for the
|
||||
|
@ -97,7 +96,7 @@ type seenNames map[string]struct{}
|
|||
func (jp *jsonPacker) AddEntry(e Entry) (int, error) {
|
||||
// if Name is not valid utf8, switch it to raw first.
|
||||
if e.Name != "" {
|
||||
if !common.IsValidUtf8String(e.Name) {
|
||||
if !utf8.ValidString(e.Name) {
|
||||
e.NameRaw = []byte(e.Name)
|
||||
e.Name = ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue