JDK 18 |
---|
18Resolved |
A new method `Charset.forName()` that takes `fallback` charset object has been introduced in `java.nio.charset` package. The new method returns `fallback` if `charsetName` is illegal or the charset object is not available for the name. If `fallback` is passed as `null` the caller can check if the named charset was available without having to catch the exceptions thrown by the `Charset.forName(name)` method.