Repository navigation
Property-Files: use native encoding by default and allow project/IDE wide configuration - #9748
Open
matthiasblaesing wants to merge 5 commits into
Open
matthiasblaesing wants to merge 5 commits into
matthiasblaesing wants to merge 5 commits into
Conversation
…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.
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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