wrapper.jvm.encoding

Kompatibel :3.5.35
Editionen :Professional EditionStandard EditionCommunity Edition (Not Supported)
Betriebssysteme :WindowsMac OSXLinuxAlpine LinuxIBM AIXFreeBSDSolarisIBM z/Linux

This property is used to set the JVM's default encoding when it should differ from the encoding used by the Wrapper, or to specify an encoding other than UTF-8 when using Java 18 and later. The value specified with wrapper.jvm.encoding is supplied to the JVM via the file.encoding system property on the command line.

Valid values include:

  • UTF-8: This is the recommended value when using Java 18 and later versions. It also works with earlier JVMs.

  • COMPAT (Since ver. 3.7.0): This token is resolved as follows:
    - On Java 18 and later, COMPAT is passed as-is to the JVM, causing Java to determine the default encoding in compatibility mode, as it did in Java 17.
    - On Java 17 and earlier, COMPAT is interpreted by the Wrapper itself and translated into the ANSI Code Page on Windows, or the encoding based on the locale at the time the Wrapper starts on Unix.

  • WRAPPER * (Since ver. 3.7.0): This token is used to specify the same encoding as the Wrapper process (i.e. the value of wrapper.lang.<platform>.encoding automatically converted into the corresponding Java notation).
    Note that this has been the default behavior for Wrapper versions before 3.7.0 regardless the Java version, and is still the default for Java 17 and earlier versions.

  • <canonical_name> *: A valid file.encoding value supported by the current JVM (e.g., ISO-8859-1, windows-1252, etc.). For example, Oracle Java 17 supports the following encodings.
    Note that in Java 18 and later, the only officially supported values for file.encoding are 'UTF-8' and 'COMPAT'.

  • DEFAULT: This is the default value.
    - On Java 18 and later, the default behavior is not to pass the encoding to the JVM (i.e. let it use UTF-8).
    - On Java 17 and earlier, the default behavior is to resolve the JVM encoding as described for the WRAPPER value.

* If the specified encoding (or the encoding resolved when using WRAPPER) is not supported by the current JVM, the Wrapper will log an error message and stop. However, this restriction can be lifted by setting wrapper.jvm.encoding.allow_unsupported to TRUE.

Example: (set the JVM default encoding to 'COMPAT' mode)
wrapper.jvm.encoding=COMPAT

NOTE

Setting wrapper.jvm.encoding is only supported when the JVM allows specifying a separate encoding for standard output. This requires either support for the stdout.encoding and stderr.encoding system properties (available in Java 18 and later), or the sun.stdout.encoding and sun.stderr.encoding properties (available in Oracle and OpenJDK implementations starting with Java 8). The Wrapper always checks for this support, but if wrapper.jvm.encoding is set to a value other than DEFAULT, it will only launch the application if the necessary conditions are met.

WARNING

Usage of this property (any value other than 'DEFAULT') requires that there is no reference of 'file.encoding', 'stdout.encoding','stderr.encoding', 'sun.stdout.encoding', or 'sun.stderr.encoding' in the arguments passed to the JVM, otherwise the Wrapper will stop.

This property is not reloaded when the JVM restarts and wrapper.restart.reload_configuration is set to TRUE. However, if any of the above system properties were added in the JVM arguments while this property being set, the Wrapper will stop.

wrapper.jvm.encoding.allow_unsupported

Kompatibel :3.7.0
Editionen :Professional EditionStandard EditionCommunity Edition (Not Supported)
Betriebssysteme :WindowsMac OSXLinuxAlpine LinuxIBM AIXFreeBSDSolarisIBM z/Linux

This property lets the Wrapper skip validating the wrapper.jvm.encoding value against encodings supported by the current Java version. This can be useful, particularly when using Java 18 or later, where only 'UTF-8' and 'COMPAT' are officially supported by the JVM, but many other encodings - while no longer guaranteed - are still documented as "likely to continue to work".

The default value is FALSE.

Example: (allow 'EUC-JP' to be passed to the JVM even though it is not officially supported by Java 18+)
wrapper.lang=en_US
wrapper.lang.unix.encoding=UTF-8

# This will add -Dfile.encoding=EUC-JP to the command line, which is not officially supported by Java 18+.
wrapper.jvm.encoding=EUC-JP

# Without this property, the Wrapper would stop.
wrapper.jvm.encoding.allow_unsupported=TRUE