

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the enhancements in Internationalization in Java 9?
<p><strong>Internationalization </strong>enhancements in Java 9 include <strong>Unicode 8.0</strong>,<strong> UTF-8</strong> properties files and enabling <strong>CLDR </strong><strong>locale </strong><strong>data </strong>by default. Java 9 supports up to <strong>Unicode </strong><strong>8.0 standards</strong> with 10,555 characters, 29 scripts, and 42 blocks.</p><p>In Java 9, the properties files are loaded in<strong> UTF-8 encoding</strong>. By default, reading an input stream throws <strong>MalformedInputException </strong>or <strong>UnmappableCharacterException</strong>. In this case, <strong>PropertyResourceBundle </strong>instance reset to a state before the exception, re-reads the input stream in <strong>ISO-8859-1</strong>, and continues reading.</p><p>If <strong>PropertyResourceBundle.</strong><span style="font-weight: 700; background-color: initial; text-align: initial;">encoding</span><span style="font-weight: 700; background-color: initial; text-align: initial;"> </span><span style="background-color: initial; text-align: initial;">has set to either </span><strong style="background-color: initial; text-align: initial;">ISO-8859-1</strong><span style="background-color: initial; text-align: initial;"> or </span><strong style="background-color: initial; text-align: initial;">UTF-8</strong><span style="background-color: initial; text-align: initial;">, then <strong>PropertyResourceBundle </strong>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 <strong>PropertyResourceBundle </strong>class, then any action that changes or removes the property has no effect.</span></p><p>If we specify<strong> ISO-8859-1</strong>:</p><ul class="list"><li>Characters that can't be represented in <strong>ISO-8859-1</strong> <strong>encoding </strong>must be represented by <strong>Unicode </strong><strong>escapes</strong>.</li><li>Other encoding values have ignored this system's property.</li></ul><p style="">If there is an issue, we can consider the below options:</p><ul class="list"><li>Convert the <strong>properties file</strong> into <strong>UTF-8 encoding</strong>.</li><li>Specify the runtime system property.</li></ul><pre class="prettyprint notranslate" style=""><strong>java.util.PropertyResourceBundle.encoding=ISO-8859-1</strong></pre>
- Related Questions & Answers
- What are the main features and enhancements introduced in Java 9?
- Interface enhancements in Java 8
- What are the CompletableFuture API improvements in Java 9?
- What are the different module types in Java 9?
- What are the advantages of Modules in Java 9?
- What are Compact Strings in Java 9?
- What are automatic 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 benefits of immutable collections in Java 9?
- What are the characteristics of a module in Java 9?
- What are the benefits of a module in Java 9?
- What are the improvements for @Deprecated annotation in Java 9?
- What are the changes of class loaders in Java 9?
Advertisements