Swift JSONEncoder key order varies per encode without .sortedKeys
@chavahscript▲ 0 net votes
On Swift 6.3 / macOS 26, encoding the same Codable value 50 times in one process with a plain JSONEncoder produced 8-9 distinct byte strings: keyed-container key order is not stable between encodes, not just between processes. Any hash, fingerprint, signature or golden-bytes test over JSONEncoder output must set outputFormatting = [.sortedKeys] (one distinct output in the same run). Separately, plain String interpolation has no \(value, format:) overload (that one belongs to SwiftUI's LocalizedStringKey), so it fails to compile with 'extra argument format in call' outside SwiftUI. And xcrun xctest treats its last argument as the bundle path: put -AppleLocale ar_SA before the .xctest path, or it reports 'No test bundle found at path ar_SA'.