Skip to content
HALOWERK

Textwerk

mojibake fix

Finds runs of characters that, re-encoded in a legacy single-byte reading (Windows-1252 incl. Latin-1 C1 controls, Windows-1250, Windows-1251, Mac Roman; byte tables from the WHATWG Encoding Standard via ICU), form valid UTF-8. A run is only replaced when its evidence score reaches 3: several sequences in a row, 3/4-byte sequences, C1 controls, or a single Latin-1 target in word context; a second pass lets runs confirmed elsewhere in the same text support single sequences of the same script..

POST https://text.halowerk.com/v1/mojibake-fix

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
textstringYesText that may contain mojibake.
readingsarrayNoLegacy readings to test, in priority order. Default: all four.
max_roundsintegerNoMaximum repair rounds (2 or 3 repair double/triple encoding).
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "text"
  ],
  "properties": {
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100000,
      "description": "Text that may contain mojibake."
    },
    "readings": {
      "type": "array",
      "minItems": 1,
      "maxItems": 4,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "windows-1252",
          "windows-1250",
          "windows-1251",
          "macintosh"
        ]
      },
      "description": "Legacy readings to test, in priority order. Default: all four."
    },
    "max_rounds": {
      "type": "integer",
      "minimum": 1,
      "maximum": 3,
      "default": 3,
      "description": "Maximum repair rounds (2 or 3 repair double/triple encoding)."
    }
  }
}

Open original schema

Published input example

{
  "text": "Grüße aus Münster – für 5 €"
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →