support import delimiter-separated values file / data with UTF-16 with BOM encoding (#361)

This commit is contained in:
MaysWind
2025-11-26 22:54:57 +08:00
parent bd704a8c15
commit 9faea14e36
17 changed files with 34 additions and 0 deletions

View File

@@ -35,6 +35,8 @@ var supportedFileEncodings = map[string]encoding.Encoding{
"utf-8-bom": unicode.UTF8BOM, // UTF-8 with BOM
"utf-16le": unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM), // UTF-16 Little Endian
"utf-16be": unicode.UTF16(unicode.BigEndian, unicode.IgnoreBOM), // UTF-16 Big Endian
"utf-16le-bom": unicode.UTF16(unicode.LittleEndian, unicode.ExpectBOM), // UTF-16 Little Endian with BOM
"utf-16be-bom": unicode.UTF16(unicode.BigEndian, unicode.ExpectBOM), // UTF-16 Big Endian with BOM
"cp437": charmap.CodePage437, // OEM United States (CP-437)
"cp863": charmap.CodePage863, // OEM Canadian French (CP-863)
"cp037": charmap.CodePage037, // IBM EBCDIC US/Canada (CP-037)

View File

@@ -14,6 +14,8 @@ export const SUPPORTED_FILE_ENCODINGS: string[] = [
'utf-8-bom', // UTF-8 with BOM
'utf-16le', // UTF-16 Little Endian
'utf-16be', // UTF-16 Big Endian
'utf-16le-bom', // UTF-16 Little Endian with BOM
'utf-16be-bom', // UTF-16 Big Endian with BOM
'cp437', // OEM United States (CP-437)
'cp863', // OEM Canadian French (CP-863)
'cp037', // IBM EBCDIC US/Canada (CP-037)

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM United States (CP-437)",
"cp863": "OEM Canadian French (CP-863)",
"cp037": "IBM EBCDIC US/Canada (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM United States (CP-437)",
"cp863": "OEM Canadian French (CP-863)",
"cp037": "IBM EBCDIC US/Canada (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM United States (CP-437)",
"cp863": "OEM Canadian French (CP-863)",
"cp037": "IBM EBCDIC US/Canada (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 avec BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM États-Unis (CP-437)",
"cp863": "OEM Canadien Français (CP-863)",
"cp037": "IBM EBCDIC États-Unis/Canada (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM United States (CP-437)",
"cp863": "OEM Canadian French (CP-863)",
"cp037": "IBM EBCDIC US/Canada (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM 米国 (CP-437)",
"cp863": "OEM カナダ系フランス語 (CP-863)",
"cp037": "IBM EBCDIC 米国/カナダ (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 리틀 엔디안",
"utf-16be": "UTF-16 빅 엔디안",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM 미국 (CP-437)",
"cp863": "OEM 캐나다 프랑스어 (CP-863)",
"cp037": "IBM EBCDIC 미국/캐나다 (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM United States (CP-437)",
"cp863": "OEM Canadian French (CP-863)",
"cp037": "IBM EBCDIC US/Canada (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 com BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM Estados Unidos (CP-437)",
"cp863": "OEM Francês Canadense (CP-863)",
"cp037": "IBM EBCDIC EUA/Canadá (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM United States (CP-437)",
"cp863": "OEM Canadian French (CP-863)",
"cp037": "IBM EBCDIC US/Canada (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 พร้อม BOM",
"utf-16le": "UTF-16 Endian เล็ก",
"utf-16be": "UTF-16 Endian ใหญ่",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM สหรัฐอเมริกา (CP-437)",
"cp863": "OEM ฝรั่งเศสแคนาดา (CP-863)",
"cp037": "IBM EBCDIC สหรัฐอเมริกา/แคนาดา (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM United States (CP-437)",
"cp863": "OEM Canadian French (CP-863)",
"cp037": "IBM EBCDIC US/Canada (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 with BOM",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian with BOM",
"utf-16be-bom": "UTF-16 Big Endian with BOM",
"cp437": "OEM United States (CP-437)",
"cp863": "OEM Canadian French (CP-863)",
"cp037": "IBM EBCDIC US/Canada (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 带签名",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian 带签名",
"utf-16be-bom": "UTF-16 Big Endian 带签名",
"cp437": "OEM 美国 (CP-437)",
"cp863": "OEM 加拿大法语 (CP-863)",
"cp037": "IBM EBCDIC 美国/加拿大 (CP-037)",

View File

@@ -1336,6 +1336,8 @@
"utf-8-bom": "UTF-8 帶簽名",
"utf-16le": "UTF-16 Little Endian",
"utf-16be": "UTF-16 Big Endian",
"utf-16le-bom": "UTF-16 Little Endian 帶簽名",
"utf-16be-bom": "UTF-16 Big Endian 帶簽名",
"cp437": "OEM 美國 (CP-437)",
"cp863": "OEM 加拿大法語 (CP-863)",
"cp037": "IBM EBCDIC 美國/加拿大 (CP-037)",