mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
select: Check if CSV is valid utf8 (#10991)
Check if first block of data is valid utf8. Fixes #10970
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package csv
|
||||
|
||||
import "errors"
|
||||
|
||||
type s3Error struct {
|
||||
code string
|
||||
message string
|
||||
@@ -51,3 +53,12 @@ func errCSVParsingError(err error) *s3Error {
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
|
||||
func errInvalidTextEncodingError() *s3Error {
|
||||
return &s3Error{
|
||||
code: "InvalidTextEncoding",
|
||||
message: "UTF-8 encoding is required.",
|
||||
statusCode: 400,
|
||||
cause: errors.New("invalid utf8 encoding"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user