Encoding determination

Sometimes you may be dissatisfied by automatic encoding determination. In such cases you can load and save json file with defined encoding. Example:

[
  {
    "partners": [],
    "fileType": "EDIFACT",
    "payloadMatchingExpression": "^.*?UNB\\+(UNOA|UNOB|UNOC):",
    "encoding": "ISO-8859-1"
  },
  {
    "partners": [],
    "fileType": "EDIFACT",
    "payloadMatchingExpression": "^.*?UNB\\+UNOD:",
    "encoding": "ISO-8859-2"
  },
  {
    "partners": [],
    "fileType": "X12",
    "encoding": "IBM437"
  },
  {
    "partners": [],
    "fileType": "TRADACOMS",
    "encoding": "ISO-8859-1"
  },
  {
    "partners": [],
    "fileType": "EDIFACT",
    "encoding": "ISO-8859-1"
  },
  {
    "partners": [
      "PARTNER1",
      "PARTNER2",
      "PARTNER3"
    ],
    "fileType": "EDIFACT",
    "encoding": "GB2312"
  },
  {
    "messages": [],
    "fileType": "XML",
    "encoding": "ISO-8859-3"
  }
]

The configuration should satisfy the conditions:

  1. Either fileType, partners, or messages must be set.

  2. Configuration with partners has the highest priority and overrides any configuration with messages and/or fileType.

  3. Configuration with messages has higher priority than configurations with fileType and overrides such configurations.

  4. payloadMatchingExpression (it’s regex) is optional, it just means that in addition to config lookup it should check if payload matches (partially - it means that at least one matched part found) specified regex.

  5. If many configs were found during lookup, the first matching config is used.

  6. UTF-8 s always used for parsing when payloadMatchingExpression is defined.

To download configured encoding determination rules click on download light.