documentation/Reference/Configuration/Flyway Namespace/Flyway Encoding Setting.md
The encoding of SQL migrations.
The encodings that Flyway supports are:
US-ASCIIISO-8859-1UTF-8UTF-16BEUTF-16LEUTF-16We recommend using a consistent file encoding across all of your scripts to minimize the issues you encounter. See the Troubleshooting section below for known problems and solutions.
Note that this setting can be set from Script Configuration in addition to project configuration.
String
"UTF-8"
This can't be set in a config file via Flyway Desktop, although it will be honoured, and it can be configured as an advanced parameter in operations on the Migrations page. It will be honoured by Flyway Desktop when viewing or generating migration scripts.
./flyway -encoding="UTF-16" info
[flyway]
encoding = "UTF-16"
flyway.encoding=UTF-16
flyway.encoding=UTF-16
FLYWAY_ENCODING=UTF-16
Flyway.configure()
.encoding("UTF-16")
.load()
flyway {
encoding = 'UTF-16'
}
<configuration>
<encoding>UTF-16</encoding>
</configuration>
This is because some encoding names are synonyms for others. For instance, an editor which specifies ANSI is actually
ISO-8859-1.
This exception is due to inconsistent encoding configurations.
ISO-8859-1 is the most compatible supported encoding, so using this encoding could fix your configuration. However, we recommend that all of your scripts have the same encoding.