Android XML often mixes plain text with inline tags and entities. Double encoding can break UI text rendering.
Common Symptoms
Double encoding usually appears as:
<or>showing in app UI.- Markup fragments rendering as literal text.
- Strings changing after repeated parse/write cycles.
Safe Practices
- Keep inline tags as XML markup where possible (
<em>,<xliff:g>). - Avoid manually escaping the same value multiple times.
- Validate output after round-trip parse/write flows.
Practical Workflow
- Keep source XML valid and parser-friendly.
- Run sync and inspect generated Android resource output.
- Spot-check strings containing entities and inline markup.
- If output changed unexpectedly, compare source vs generated value and remove duplicate manual escaping.
Built-In Protections
String Catalog writer:
- Escapes only bare ampersands.
- Preserves inline markup fragments.
- Avoids turning
<...>into&lt;...&gt;during standard round trips.
Expected Outcome
You should get Android app localization output that preserves intended entities and inline tags without cumulative escaping artifacts.
Common Mistakes
- Mixing pre-escaped and raw forms of the same token across files.
- Editing generated XML and re-escaping content by hand.
- Treating inline markup as plain text in source values.