Escape .properties files the native2ascii way
Convert non-ASCII in Java .properties files to uppercase \uXXXX escapes — the safety net the JDK's removed native2ascii tool provided. Runs in your browser.
Java's .properties format is read as ISO-8859-1, so every non-ASCII character must be written as an uppercase \uXXXX escape or it turns to mojibake at runtime. The JDK shipped a native2ascii tool for exactly this job — then removed it in JDK 9. This page replaces it: paste your messages_zh.properties content and every 中文 character comes out as uppercase \uXXXX escapes while keys, equals signs, comments and line breaks pass through untouched.
The output is a drop-in replacement file ready for your resources folder. Going the other way, paste an escaped file and the \uXXXX sequences decode back to readable text — handy for sending translation files to people who can't read escapes.
Newer options exist (UTF-8 resource bundles since JDK 9, XML properties), but legacy stacks, old Spring apps and translated resource bundles still demand the escaped form. Everything converts locally in your browser — safe for unreleased translation files.
Frequently asked questions
- Why does my properties file show garbage like 䏿–‡?
- That's UTF-8 bytes read as ISO-8859-1 — the classic properties mojibake. Resource bundles read .properties files as Latin-1 (pre-JDK 9 always; later versions unless configured otherwise), so non-ASCII must be escaped as \uXXXX to survive.
- Which JDK versions need this?
- JDK 8 and earlier always, since native2ascii was the official fix. JDK 9 removed the binary while bundles started reading UTF-8 — but any setup still loading properties as Latin-1 needs escaped files, which is why this page exists.
- Can I decode escapes back to readable text?
- Yes — switch to decode mode and paste the escaped file. Uppercase \uXXXX sequences turn back into real characters, giving you a readable .properties to edit or send to translators.