file-encoding

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

Uses

If you need Liquibase to read 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

You can set this parameter in the following ways:

Option Syntax
Liquibase properties file (defaults file)
liquibase.fileEncoding: <string>
Global flow file argument (example)
stages:
  Default:
    actions:
      - type: liquibase
        command: update
        globalArgs: { file-encoding: "<string>" }
Global CLI parameter
liquibase
 --file-encoding=<string> update
 --changelog-file=example-changelog.xml

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.fileEncoding=<string>
Liquibase Environment Variables
LIQUIBASE_FILE_ENCODING=<string>

For more information, see Working with Command Parameters.

Related links