When considering files in textual form (for example when doing text replacement), the engine needs to decide which encoding to use.

By default, UTF-8 is assumed, but if (some) files need to be handled differently, the UseEncoding transform can be used to annotate them with an explicit encoding.

It is an error to apply an encoding to files which have already been configured with a particular encoding.

Syntax Reference

type: UseEncoding
encoding: <encoding>    # As recognized by the java java.nio.charset.Charset class
condition: <SpEL expression>

Example supported encoding names are UTF-8, US-ASCII, ISO-8859-1, etc.

Example Usage

UseEncoding is typically used as an upfront transform to e.g. ReplaceText in a chain:

type: Chain   # Or using "Combo"
  - type: UseEncoding
    encoding: ISO-8859-1
  - type: ReplaceText
      - text: "hello"
        with: "#howToSayHello" 

See Also

check-circle-line exclamation-circle-line close-line
Scroll to top icon