diff --git a/Scripts/Translations/AlphabetizeStrings.swift b/Scripts/Translations/AlphabetizeStrings.swift index bacdb0b4..8dd7eb38 100644 --- a/Scripts/Translations/AlphabetizeStrings.swift +++ b/Scripts/Translations/AlphabetizeStrings.swift @@ -16,7 +16,7 @@ let fileURL = URL(fileURLWithPath: "./Translations/en.lproj/Localizable.strings" let regex = #/^\"(?[^\"]+)\"\s*=\s*\"(?[^\"]+)\";/# // Attempt to read the file content. -guard let content = try? String(contentsOf: fileURL, encoding: .utf8) else { +guard let content = try? String(contentsOf: fileURL, encoding: .utf16) else { print("Unable to read file: \(fileURL.path)") exit(1) } @@ -43,10 +43,10 @@ let newContent = sortedKeys.map { "/// \(entries[$0]!)\n\"\($0)\" = \"\(entries[ // Write the updated, sorted, and commented localizations back to the file. do { - try newContent.write(to: fileURL, atomically: true, encoding: .utf8) + try newContent.write(to: fileURL, atomically: true, encoding: .utf16) if let derivedFileDirectory = ProcessInfo.processInfo.environment["DERIVED_FILE_DIR"] { - try? "".write(toFile: derivedFileDirectory + "/alphabetizeStrings.txt", atomically: true, encoding: .utf8) + try? "".write(toFile: derivedFileDirectory + "/alphabetizeStrings.txt", atomically: true, encoding: .utf16) } } catch { print("Error: Failed to write to \(fileURL.path)") diff --git a/Translations/en.lproj/Localizable.strings b/Translations/en.lproj/Localizable.strings index fcab6c93..182b7e2e 100644 Binary files a/Translations/en.lproj/Localizable.strings and b/Translations/en.lproj/Localizable.strings differ