1
0
Fork 1
mirror of https://github.com/vbatts/tar-split.git synced 2024-11-15 04:58:36 +00:00
tar-split/tar/common/utf8.go

22 lines
389 B
Go
Raw Normal View History

2015-09-23 17:30:00 +00:00
package common
// IsValidUtf8String checks for in valid UTF-8 characters
func IsValidUtf8String(s string) bool {
for _, r := range s {
if int(r) == 0xfffd {
return false
}
}
return true
}
// IsValidUtf8Btyes checks for in valid UTF-8 characters
func IsValidUtf8Btyes(b []byte) bool {
for _, r := range string(b) {
if int(r) == 0xfffd {
return false
}
}
return true
}