
- Java Tutorial
- Java - Home
- Java - Overview
- Java - Environment Setup
- Java - Basic Syntax
- Java - Object & Classes
- Java - Constructors
- Java - Basic Datatypes
- Java - Variable Types
- Java - Modifier Types
- Java - Basic Operators
- Java - Loop Control
- Java - Decision Making
- Java - Numbers
- Java - Characters
- Java - Strings
- Java - Arrays
- Java - Date & Time
- Java - Regular Expressions
- Java - Methods
- Java - Files and I/O
- Java - Exceptions
- Java - Inner classes
- Java Object Oriented
- Java - Inheritance
- Java - Overriding
- Java - Polymorphism
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java Advanced
- Java - Data Structures
- Java - Collections
- Java - Generics
- Java - Serialization
- Java - Networking
- Java - Sending Email
- Java - Multithreading
- Java - Applet Basics
- Java - Documentation
- Java Useful Resources
- Java - Questions and Answers
- Java - Quick Guide
- Java - Useful Resources
- Java - Discussion
- Java - Examples
What are the enhancements in Internationalization in Java 9?
Internationalization enhancements in Java 9 include Unicode 8.0, UTF-8 properties files and enabling CLDR locale data by default. Java 9 supports up to Unicode 8.0 standards with 10,555 characters, 29 scripts, and 42 blocks.
In Java 9, the properties files are loaded in UTF-8 encoding. By default, reading an input stream throws MalformedInputException or UnmappableCharacterException. In this case, PropertyResourceBundle instance reset to a state before the exception, re-reads the input stream in ISO-8859-1, and continues reading.
If PropertyResourceBundle.encoding has set to either ISO-8859-1 or UTF-8, then PropertyResourceBundle instance read an input stream in that encoding, and throw an exception if encountering an invalid sequence. The system property read and evaluated when initializing the PropertyResourceBundle class, then any action that changes or removes the property has no effect.
If we specify ISO-8859-1:
- Characters that can't be represented in ISO-8859-1 encoding must be represented by Unicode escapes.
- Other encoding values have ignored this system's property.
If there is an issue, we can consider the below options:
- Convert the properties file into UTF-8 encoding.
- Specify the runtime system property.
java.util.PropertyResourceBundle.encoding=ISO-8859-1
- Related Articles
- What are the main features and enhancements introduced in Java 9?
- Interface enhancements in Java 8
- What are automatic modules in Java 9?
- What are Compact Strings in Java 9?
- What are the different module types in Java 9?
- What are the advantages of Modules in Java 9?
- What are the improvements in Process API in Java 9?
- What are the useful commands in JShell in Java 9?
- What are the changes in Memory Management in Java 9?
- What are the different shortcut keys in JShell in Java 9?
- What are the different feedback modes in JShell in Java 9?
- What are the different "/edit" commands in JShell in Java 9?
- What are the different startup scripts in JShell in Java 9?
- What are the different "/types" commands in JShell in Java 9?
- What are the different "/vars" commands in JShell in Java 9?
