Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A character encoding or charset specifies the binary representation of the coded character set.  Every instance of the Java virtual machine (JVM) has a default charset, which may or may not be one of the standard charsets. The default charset is determined during virtual-machine startup and typically depends upon the locale and charset being used by the underlying operating system [API 2014]. The default character encoding can be set at startup, for example:

...

The available encodings are listed in the Supported Encodings document [Encodings 2014].  In the absence of an explicitly specified encoding, conversions use the system default encoding. Compatible encodings must be used when characters are output as array of bytes then input by another JVM and subsequently converted back to characters.

According to the Java API  [API 2014] for the String class:

The behavior of this constructor when the given bytes are not valid in the given charset is unspecified.

...

Sound automated detection of this vulnerability is not feasible.

Bibliography