--- title: "EncodingPatcher" slug: "encoding-patcher" updated: 2026-09-09T08:56:56Z published: 2026-09-09T08:56:56Z canonical: "docs.lobstersoftware.com/encoding-patcher" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # EncodingPatcher | **Class name** | com.ebd.hub.datawizard.parser.stream.EncodingPatcher | | --- | --- | ## Description This Preparser is able to replace bytes or byte sequences with other bytes, byte sequences, or nothing. The main use of this preparser is the repair of damaged data. Statements for the replacements are stored in a properties file. One statement is equal to one line with the following structure: *0xHEXA1=0xHEXA2* ## Example | 0xE9=0x20 | Replaces every byte *E9* with the byte *20*. | | --- | --- | | 0x0d0a= | Replaces the byte sequence *0D0A* with nothing. | | 0x04=0x0D0A | Replaces the control character *04* with *0D0A* (CR-LF). | The hex characters *A* to *F* can either be written in lowercase or uppercase. Every byte sequence must have an even number of hex characters. Every statement is on the same hierarchy level, independent of the order in the configuration file. The byte sequence on the left side of the *=* is replaced with the byte sequence on the right side of the *=*. It is possible to chain up several EncodingPatchers with the [ChainPreParser](/v1/docs/en/chain-pre-parser). ## Example file ```sample #! class = com.ebd.hub.datawizard.parser.stream.EncodingPatcher # Properties File for formatting EDI and TradaComs # Encoding: only ISO-8859_1 or ASCII. For UTF8 use with care. # UNA:+.? '\r\n  replace nothing 0x554E413A2B2E3F20270D0A = 0x554E413A2B2E3F20270D0A # UNA:+.? '\n  ->  UNA:+.? '\r\n 0x554E413A2B2E3F20270A   = 0x554E413A2B2E3F20270D0A # UNA:+.? 'UN  ->  UNA:+.? '\r\nUN 0x554E413A2B2E3F2027554E   = 0x554E413A2B2E3F20270D0A554E # ?? replace nothing 0x3F3F = 0x3F3F # ?' replace nothing 0x3F27 = 0x3F27 # '\r\n replace nothing 0x270D0A = 0x270D0A # '\n  -> '\r\n 0x270A   = 0x270D0A # '    -> '\r\n 0x27     = 0x270D0A # \r\n -> remove it 0x0D0A   = # \n   -> remove it 0x0A     = ``` Optional intermediate phase before Phase 2. A preparser manipulates input data before the parser processes it; for example, to remove special characters or convert an unknown format to a supported one.