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

Aperta
#1,204 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

  • #1205 di @webkubor — chiusa senza merge

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
macos, swift, xml

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Swift
Stelle
6.6k
Fork
586
Merge medio
1g 19h
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rime/squirrel

Tutte le issue di rime/squirrel

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.