Skip to content

Property-Files: use native encoding by default and allow project/IDE wide configuration - #9748

Open
matthiasblaesing wants to merge 5 commits into
apache:masterfrom
matthiasblaesing:properties_encoding
Open

matthiasblaesing wants to merge 5 commits into
apache:masterfrom
matthiasblaesing:properties_encoding

Conversation

@matthiasblaesing

@matthiasblaesing matthiasblaesing commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Traditionally property files for Java used Latin1/ASCII encoding. Characters outside the Latin1-Range had to be encoded as unicode escapes. The Euro-Sign for example had to be written as \u20ac.

Since JDK 9 ResourceBundle defaults to UTF-8 for reading property files, rendering escape codes useless.

This aligns NetBeans with other editors, that never got the comfort of transparent UniCode input <-> escape encoding.

It was always possible to switch between native encoding and using escapes on a per file basis, but for large codebases this is a tedious process:

grafik

To support mixed setups, the encoding variant to use can now be configured in the "Editor" -> "Formatting" options. This can be done in the options dialog globally

grafik

and in the project dialog on a per project basis:

grafik

Compatibility note

Property files written in native encoding (normally UTF-8) are incompatible with Properties#load(InputStream), which still expects the legacy format.

Closes: #4351

…wide configuration

Traditionally property files for Java used Latin1/ASCII encoding.
Characters outside the Latin1-Range had to be encoded as unicode
escapes. The Euro-Sign for example had to be written as \u20ac.

Since JDK 9 ResourceBundle defaults to UTF-8 for reading property files,
rendering escape codes useless.

This aligns NetBeans with other editors, that never got the comfort of
transparent UniCode input <-> escape encoding.

It was always possible to switch between native encoding and using
escapes on a per file basis, but for large codebases this is a tedious
process.

To support mixed setups, the encoding variant to use can now be
configured in the "Editor" -> "Formatting" options. This can be done
in the options dialog globally and in the project dialog on a per
project basis.
@matthiasblaesing matthiasblaesing added this to the NB33 milestone Oct 24, 2026
@matthiasblaesing matthiasblaesing added ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Platform [ci] enable platform tests (platform/*) tests labels Oct 24, 2026
@apache apache locked and limited conversation to collaborators Oct 24, 2026
@apache apache unlocked this conversation Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Platform [ci] enable platform tests (platform/*) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better UTF-8 properties files support

1 participant