output-file-encoding

The output-file-encoding global parameter is a string that determines which character encoding to use when writing Liquibase command outputs to external files. By default, it is set to UTF-8.

Uses

If you need to send the output of a Liquibase command like generate-changelog command, update-sql command, or diff command to a text file that does not use UTF-8, you must specify the correct character encoding. This ensures that all symbols in your file display correctly.

Alternative or legacy character encodings include US-ASCII, Windows-1252, UTF-16, and others.

Syntax

For more information, see Working with Command Parameters. You can set this parameter in the following ways:

Option Syntax
Liquibase properties file
liquibase.outputFileEncoding: <string>
Global CLI parameter
liquibase
 --output-file-encoding=<string> update
 --changelog-file=mychangelog.xml

JVM system property

JAVA_OPTS Environment Variable

macOS/Linux:
JAVA_OPTS=-Dliquibase.outputFileEncoding=<string>
Windows:
set JAVA_OPTS=-Dliquibase.outputFileEncoding=<string>
Liquibase Environment Variables macOS/Linux:
LIQUIBASE_OUTPUT_FILE_ENCODING=<string>
Windows:
set LIQUIBASE_OUTPUT_FILE_ENCODING=<string>

Note: These commands only apply to the current shell. To set permanent environment variables, see Liquibase Environment Variables.