![]() |
VOOZH | about |
In Java programming, Character encoding plays an important when we talk about handling data and information across different systems. The java.nio.charset package contains classes for managing character encoding and decoding. CodingErrorAction class is one of the package's core classes. This class describes the actions to be taken when an encoding or decoding issue arises.
The java.nio.charset.CodingErrorAction class is an enum representing different actions to be handled in response to encoding or decoding errors. These actions help the developer to define how the encoding or decoding process will proceed once unexpected situations occur.
Method | Description |
|---|---|
toString() | Returns a string describing this action. |
Field | Description |
|---|---|
IGNORE | Error should be handled by dropping the erroneous input and resuming the coding operation |
REPLACE | Error should be handled by dropping the erroneous input, appending the replacement value to the output buffer |
REPORT | Error is to be reported to the developer |
Let's take an example where we will be using java.nio.charset.CodingErrorAction IGNORE property to ignore the exceptions caused during encoding or decoding.
Output:
Hello, ,