mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 23:53:13 +09:00
Ignore BOM in locale files
Ignore BOM at the start of Factorio locale files as this is a thing Factorio also does. Fixes #507
This commit is contained in:
1 parent
6eda1f78d5
commit
f23e442c4c
3 files changed
+14
No files matched your search
@@ -11,6 +11,11 @@
|
||||
* @returns sections parsed from the ini file.
|
||||
*/
|
||||
export function parse(input: string) {
|
||||
// Ignore BOM at the start of the file
|
||||
if (input[0] === "\uFEFF") {
|
||||
input = input.slice(1);
|
||||
}
|
||||
|
||||
const sections: Record<string, string | Record<string, string>> = {};
|
||||
let currentSection: Record<string, string> = sections as Record<string, string>;
|
||||
const lines = input.split(/\r\n|\n/);
|
||||
|
||||
Reference in new issue
Block a user