XML encoding declaration mismatch in .strings files causes localized names to fail

Open
#1,204 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #1205 by @webkubor — closed without merging

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
macos, swift, xml

Research direction

The payload names no repository file, so start by finding how the app's String Catalogs (.xcstrings) become InfoPlist.strings in the built bundle — look at the Xcode project's build phases and any packaging script that runs xcodebuild/productbuild. Reproduce by building one locale and running file and xxd on the resulting .lproj/InfoPlist.strings to confirm the BOM versus the declared encoding. Done looks like the declaration matching the actual bytes and the input menu showing 鼠须管 after a rebuild; the issue only promises a build-time fix in an unmerged PR, so check with maintainers before writing it.

Written by the indexing model from the issue text.

Description

Description

The localized bundle names (e.g., 鼠须管) 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:

<?xml version="1.0" encoding="UTF-8"?>

This mismatch causes macOS to fail parsing the files, falling back to the default (English) bundle name.

Evidence

Extracted from the official Squirrel-1.1.2.pkg:

$ file zh-Hans.lproj/InfoPlist.strings
zh-Hans.lproj/InfoPlist.strings: XML 1.0 document, UTF-16 Little Endian code unit, ...

$ head -c 100 zh-Hans.lproj/InfoPlist.strings | xxd
00000000: fffe 3c00 3f00 7800 6d00 6c00 2000 7600  ..<.?.x.m.l. .v.
00000010: 6500 7200 7300 6900 6f00 6e00 3d00 2200  e.r.s.i.o.n.=.".
00000020: 3100 2e00 3000 2200 2000 6500 6e00 6300  1.0.". .e.n.c.
00000030: 6f00 6400 6900 6e00 6700 3d00 2200 5500  o.d.i.n.g.=.".U.
00000040: 5400 4600 2d00 3800 2200 3f00 3e00      T.F.-.8.".?.>.

The file is clearly UTF-16LE (BOM: ff fe), but declares UTF-8.

Impact

  • Chinese users see "Squirrel" instead of "鼠须管" in the input menu
  • Traditional Chinese users see "Squirrel" instead of "鼠鬚管"
  • All localized UI strings fail to load

Fix

PR #XXX provides a build-time fix that corrects the XML declaration to match the actual byte encoding.

Environment

  • macOS 26.5.2
  • Xcode 26.5 (Build 17C52)
  • Squirrel 1.1.2
Dominant language
Swift
Stars
6.6k
Forks
586
Avg merge
1d 19h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rime/squirrel

All issues in rime/squirrel

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.