Repository navigation
Conversation
Xcode 26.5 compiles String Catalogs (.xcstrings) into .strings files with UTF-16LE byte encoding, but the XML declaration incorrectly claims UTF-8. This causes macOS to fail parsing them, falling back to English bundle names. The fix adds a Python script that scans the build output and corrects the XML declaration to match the actual byte encoding (UTF-16). The script is invoked during the package build step. Fixes: localized bundle names (e.g. 鼠须管) not appearing in input menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The localized bundle names (鼠须管 / 鼠鬚管) are not displayed in the input menu. Instead, the English name "Squirrel" always appears.
Root Cause
Xcode 26.5 compiles String Catalogs (.xcstrings) into .strings files with UTF-16LE byte encoding, but the XML declaration incorrectly claims UTF-8:
This mismatch causes macOS to fail parsing the files, falling back to the default (English) bundle name.
Evidence (extracted from official Squirrel-1.1.2.pkg):
The file is clearly UTF-16LE (BOM: ff fe), but declares UTF-8.
Solution
This PR adds a build-time fix in
package/make_package:package/fix_strings_encoding.py- A Python script that scans all .strings files in the build output and corrects the XML declaration to match the actual byte encoding (UTF-16)package/make_package- Invokes the fix script before building the pkgThe fix is minimal, non-invasive, and only affects the build process.
Testing
Verified on macOS 26.5.2 with Xcode 26.5:
Related Issue
Fixes #1204