Redgate Summit – The Database DevOps Transformation Watch now
PASS Data Community Summit logo

PASS Data Community Summit

A hybrid conference in Seattle and online

15-18 November

Flyway Documentation

This documentation site is not updated. The new documentation can now be found on documentation.red-gate.com

Poll

Detect Encoding

Flyway Teams

Description

Whether Flyway should attempt to auto-detect the file encoding of each migration.
NOTE: We recommend using a consistent file encoding to minimize the issues you encounter and specifying it to the encoding parameter. See Troubleshooting for known problems and solutions.

Flyway can detect each of the following formats:

  • UTF-8
  • ISO-8859-1
  • UTF-16 BOMless
  • UTF-16 LE
  • UTF-16 BE

When Flyway fails to auto-detect, it will default to the configured encoding if set, UTF-8 if not.

If a script configuration file defines an encoding, auto detection will be skipped on that file.

Default

false

Usage

Commandline

./flyway -detectEncoding="true" migrate

Configuration File

flyway.detectEncoding=true

Environment Variable

FLYWAY_DETECT_ENCODING=true

API

Flyway.configure()
    .detectEncoding(true)
    .load()

Gradle

flyway {
    detectEncoding = true
}

Maven

<configuration>
    <detectEncoding>true</detectEncoding>
</configuration>