Skip to content

docs: correct the stale UTF-16LE claim about localization files - #948

Merged
QuantumExplorer merged 2 commits into
developfrom
claude/fix-claudemd-strings-encoding
Aug 9, 2026
Merged

QuantumExplorer merged 2 commits into
developfrom
claude/fix-claudemd-strings-encoding

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Aug 9, 2026 •

Copy link
Copy Markdown
Member

What

Corrects the "Localization files are UTF-16LE" gotcha in CLAUDE.md, which is inverted for the main app and was actively causing bad advice.

Why

The note said *.lproj/Localizable.strings files are UTF-16LE and instructed readers to "keep them UTF-16LE". Measured on develop:

Path Encoding Count
DashWallet/*.lproj/Localizable.strings UTF-8, no BOM 43 / 43
DashWallet/*.lproj/Localizable.stringsdict UTF-8, no BOM 43 / 43
WatchApp/*.lproj/Interface.strings UTF-16LE + BOM 40 / 43
WatchApp/{en,zh-Hans,zh-Hant-TW}.lproj/Interface.strings UTF-8 3
$ head -c 4 DashWallet/de.lproj/Localizable.strings | xxd
00000000: 2f2a 204e     /* N          <- UTF-8

$ head -c 4 WatchApp/de.lproj/Interface.strings | xxd
00000000: fffe 2f00     ../.          <- UTF-16LE BOM

So the guidance named the wrong files. Acting on it means running iconv over UTF-8 files, or "restoring" them to UTF-16 — which breaks bartycrouch, plutil, and reviewable diffs.

This isn't hypothetical: in review on #945 a reviewer cited this guideline to request that hr.lproj/Localizable.strings be converted to UTF-16LE with a BOM. Declining that required re-deriving the facts from scratch.

What changed

  • Splits the guidance by target — main app is UTF-8, WatchApp Interface.strings is UTF-16LE — and lists the three WatchApp exceptions.
  • Says explicitly not to iconv or re-encode the main-app catalogs, and why.
  • Adds a head -c 4 … | xxd check so the next reader verifies rather than trusts the doc.
  • Notes that file reports pure-ASCII UTF-8 as us-ascii, which trips people up.
  • Keeps the Transifex sync guidance; replaces "keep them UTF-16LE" with "keep each file in whatever encoding it already has".

Every command in the new note was run verbatim and produces the output shown.

Docs-only — no code or resources touched.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated localization encoding guidance for main-app and WatchApp files.
    • Added target-specific search and encoding verification commands.
    • Clarified warnings against converting main-app localization files.
    • Retained Transifex synchronization instructions.

CLAUDE.md said `*.lproj/Localizable.strings` files are UTF-16LE and told
readers to keep them that way. That is inverted for the main app: all 43
locales of `DashWallet/*.lproj/Localizable.strings` and
`Localizable.stringsdict` are UTF-8 with no BOM, and plain `grep` works on
them. The files that actually are UTF-16LE are
`WatchApp/*.lproj/Interface.strings` (40 of 43; en, zh-Hans and zh-Hant-TW
are UTF-8).

The old wording was actively harmful — acting on it means running iconv
over UTF-8 files or "restoring" them to UTF-16, which breaks bartycrouch,
plutil and reviewable diffs. It came up in review on #945, where a
reviewer cited the guideline to request exactly that conversion.

Also notes that `file` reports pure-ASCII UTF-8 as `us-ascii`, and every
example command is runnable as written.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@QuantumExplorer, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6546b959-4664-4582-8001-a771efd5934f

📥 Commits

Reviewing files that changed from the base of the PR and between 36bcf84 and f3ff8c5.

📒 Files selected for processing (2)
  • CLAUDE.md
  • scripts/convert_strings_to_utf8.sh
📝 Walkthrough

Walkthrough

Localization encoding guidance now distinguishes main-app and WatchApp files, adds search and verification commands, warns against unsafe conversions, and retains Transifex synchronization instructions.

Changes

Localization encoding guidance

Layer / File(s) Summary
Target-specific encoding documentation
CLAUDE.md
The guidance documents UTF-8 without BOM for main-app localization files and mostly UTF-16LE with BOM for WatchApp files. It adds target-specific search commands, xxd checks, and conversion warnings while retaining Transifex commands.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: llbartekll

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main documentation change: correcting outdated localization-file encoding guidance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-claudemd-strings-encoding

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CLAUDE.md`:
- Line 164: Update the conversion workflow to process only
DashWallet/**/Localizable.strings files, excluding WatchApp Interface.strings
files from recursive conversion; adjust scripts/convert_strings_to_utf8.sh
accordingly and keep the documented Transifex pull workflow consistent with this
target-aware behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ea9e6720-7666-4880-bcbe-f2f13a1545e1

📥 Commits

Reviewing files that changed from the base of the PR and between b2ac658 and 36bcf84.

📒 Files selected for processing (1)
  • CLAUDE.md

Comment thread CLAUDE.md Resolved
…talogs

scripts/convert_strings_to_utf8.sh ran `find $(pwd) -name '*.strings'` and
rewrote every match as UTF-8 without a BOM. That swept in the 40 UTF-16LE
WatchApp/*.lproj/Interface.strings files — which are UTF-16LE by design —
and anything under Pods/. Following the documented post-pull workflow
therefore silently changed encodings it should not touch.

Now scoped to DashWallet/*.lproj/Localizable.strings and .stringsdict,
and it detects the BOM instead of unconditionally rewriting, so it is
idempotent: on a clean tree it reports 'checked 86, normalised 0' and
leaves every file byte-identical. Also drops the vim dependency.

Verified both directions: no-op on the current tree, and a file forced to
UTF-16LE converts back byte-identical to the original.

Reported by CodeRabbit on #948.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@QuantumExplorer
QuantumExplorer merged commit d37d255 into develop Aug 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant