{
  "title": "CSV encoding repair",
  "human_url": "https://happytails.ai/en/data-tools/csv-encoding-repair/",
  "agent_url": "https://happytails.ai/agents/en/data-tools/csv-encoding-repair/",
  "language": "en",
  "markdown_url": "https://happytails.ai/en/data-tools/csv-encoding-repair.md",
  "content": "CSV encoding repair\nCompare raw CSV bytes under several character encodings and explicitly confirm a UTF-8 export after reviewing the text.\nHow to use CSV encoding repair\nChoose a raw CSV file and run Compare only.\nReview each candidate preview, replacement count, malformed-byte flag and mojibake warnings.\nSelect the source encoding, confirm your choice and optionally add a UTF-8 BOM before exporting.\nHow can we improve this tool?\nReport a problem or share an idea.\nPlease leave out private information. Your message and the tool name go to our team via PostHog.\nUseful next steps\nCSV column calculator\nCSV anonymizer\nA preview is not an encoding diagnosis\nUTF-8, Windows-1252, UTF-16LE, UTF-16BE and Shift_JIS candidates appear in a fixed order. Counts and BOM information are clues, not a confidence ranking. ASCII and many legacy files are ambiguous. No encoding is selected silently and no mojibake text is automatically rewritten.\nUnderstand conversion and possible loss\nThe output reparses CSV and writes quoted comma-separated UTF-8 with CRLF records. Parsed cell strings and quoted multiline content are retained before optional formula protection, while original quoting, delimiters and byte layout change. Malformed bytes or U+FFFD replacement characters require a separate explicit possible-loss permission. Previously lost text cannot be reconstructed.\nLocal processing and exact strings\nProcessing runs on your device. CSV downloads quote every cell and protect spreadsheet formula prefixes by default, which changes affected strings. Preserve original cells is for trusted machine processing. Import identifiers as text in spreadsheet applications to preserve leading zeros.",
  "content_format": "text/plain",
  "visibility": "public",
  "links": [
    {
      "name": "CSV column calculator",
      "url": "https://happytails.ai/en/data-tools/csv-column-calculator/"
    },
    {
      "name": "CSV anonymizer",
      "url": "https://happytails.ai/en/data-tools/csv-anonymizer/"
    }
  ],
  "tool": {
    "id": "csv-encoding-repair",
    "category": "data-tools",
    "built": true,
    "requirements": "One nonempty file up to 1,000,000 raw bytes, 10,000 data records, 100 columns and 100,000 data cells. Candidate previews show the first 600 decoded characters. Replacement counts include literal U+FFFD characters already in the file. Mojibake warning patterns can match legitimate text. Comparison alone produces no repaired CSV. Output is capped at 4,000,000 CSV characters.",
    "implementation": {
      "fields": [
        {
          "key": "delimiter",
          "label": "Input CSV separator",
          "value": ",",
          "type": "select",
          "values": [
            ",",
            ";",
            "\t"
          ]
        },
        {
          "key": "encoding",
          "label": "Confirmed source encoding",
          "value": "Compare only",
          "type": "select",
          "values": [
            "Compare only",
            "utf-8",
            "windows-1252",
            "utf-16le",
            "utf-16be",
            "shift_jis"
          ]
        },
        {
          "key": "confirmEncoding",
          "label": "I reviewed the candidate text and confirm this encoding",
          "value": false,
          "type": "checkbox"
        },
        {
          "key": "allowReplacement",
          "label": "Allow replacement characters and possible data loss",
          "value": false,
          "type": "checkbox",
          "help": "Required if the selected decoding has malformed bytes or U+FFFD characters. Replacement counts include any literal U+FFFD characters already present in the source."
        },
        {
          "key": "bom",
          "label": "Add UTF-8 BOM to the exported CSV",
          "value": false,
          "type": "checkbox"
        },
        {
          "key": "exportMode",
          "label": "Spreadsheet formula handling",
          "value": "Protect formulas",
          "type": "select",
          "values": [
            "Protect formulas",
            "Preserve original cells"
          ]
        }
      ],
      "registrationFamily": "csv-preparation",
      "presentation": "metrics",
      "note": "Compare the previews first, then select and confirm the source encoding. The comparison does not identify the correct encoding. Export rewrites the file as quoted UTF-8 CSV; it cannot recover text already lost. Processed on your device. CSV downloads protect spreadsheet formula prefixes by default, which changes affected cells.",
      "files": true,
      "multiple": false,
      "input": false,
      "accept": ".csv,.tsv,.txt,text/csv,text/plain",
      "maxFileBytes": 1000000,
      "experience": {
        "automatic": false,
        "single": false,
        "inputMaxLength": 1000000,
        "inputMode": "text",
        "label": "Raw CSV file",
        "placeholder": "Choose the original file bytes",
        "help": "Compare candidates first. Select and confirm an encoding before creating a UTF-8 CSV. Up to 1,000,000 characters. Review the settings before running.",
        "action": null
      },
      "mode": "explicit",
      "interactive": false
    },
    "execution": "Browser interface",
    "api": null,
    "browser_agent": {
      "supported": true,
      "name": "run_current_tool",
      "discovery": "WebMCP on the human page in a supporting browser",
      "verification": "See audit/API-AUDIT.md; availability is not verification"
    }
  },
  "markdown": "# CSV encoding repair\n\n- Human page: https://happytails.ai/en/data-tools/csv-encoding-repair/\n- Markdown: https://happytails.ai/en/data-tools/csv-encoding-repair.md\n- Structured JSON: https://happytails.ai/agents/en/data-tools/csv-encoding-repair/index.json\n- Visibility: public\n\n## Tool capabilities\n\n| Property | Value |\n| --- | --- |\n| Tool ID | `csv-encoding-repair` |\n| Category | data-tools |\n| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |\n| Browser execution | Use the visible action or interactive controls. |\n| Browser processing | Browser; see tool notes for network behavior. |\n| HTTP API | Not callable through HTTP. |\n| Browser-agent interface | run_current_tool |\n\n### Implementation notes\n\nCompare the previews first, then select and confirm the source encoding. The comparison does not identify the correct encoding. Export rewrites the file as quoted UTF-8 CSV; it cannot recover text already lost. Processed on your device. CSV downloads protect spreadsheet formula prefixes by default, which changes affected cells.\n\n### Inputs and settings\n\nNo free-text input is required. Use the file inputs and/or settings below.\n\nAccepted browser files: `.csv,.tsv,.txt,text/csv,text/plain`. Choose one file.\n\nBrowser file-input limit: 1000000 bytes in total. HTTP limits can differ.\n\n| Setting | Meaning | Control type | Default | Constraints |\n| --- | --- | --- | --- | --- |\n| `delimiter` | Input CSV separator | select | \",\" | Allowed: ,, ;, \t |\n| `encoding` | Confirmed source encoding | select | \"Compare only\" | Allowed: Compare only, utf-8, windows-1252, utf-16le, utf-16be, shift_jis |\n| `confirmEncoding` | I reviewed the candidate text and confirm this encoding | checkbox | false |  |\n| `allowReplacement` | Allow replacement characters and possible data loss | checkbox | false |  |\n| `bom` | Add UTF-8 BOM to the exported CSV | checkbox | false |  |\n| `exportMode` | Spreadsheet formula handling | select | \"Protect formulas\" | Allowed: Protect formulas, Preserve original cells |\n\n### Browser-agent workflow\n\n1. Open the human page in a browser that supports WebMCP.\n2. Discover the interface exposed by that page; use its actual schema.\n3. Select files on the page first when the tool requires files.\n4. Call `run_current_tool` with valid input and settings.\n5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.\n\nCalls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.\n\n### Planning specification\n\nOne nonempty file up to 1,000,000 raw bytes, 10,000 data records, 100 columns and 100,000 data cells. Candidate previews show the first 600 decoded characters. Replacement counts include literal U+FFFD characters already in the file. Mojibake warning patterns can match legitimate text. Comparison alone produces no repaired CSV. Output is capped at 4,000,000 CSV characters.\n\nThis describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.\n\n### Complete machine-readable capability record\n\n```json\n{\n  \"id\": \"csv-encoding-repair\",\n  \"category\": \"data-tools\",\n  \"built\": true,\n  \"requirements\": \"One nonempty file up to 1,000,000 raw bytes, 10,000 data records, 100 columns and 100,000 data cells. Candidate previews show the first 600 decoded characters. Replacement counts include literal U+FFFD characters already in the file. Mojibake warning patterns can match legitimate text. Comparison alone produces no repaired CSV. Output is capped at 4,000,000 CSV characters.\",\n  \"implementation\": {\n    \"fields\": [\n      {\n        \"key\": \"delimiter\",\n        \"label\": \"Input CSV separator\",\n        \"value\": \",\",\n        \"type\": \"select\",\n        \"values\": [\n          \",\",\n          \";\",\n          \"\\t\"\n        ]\n      },\n      {\n        \"key\": \"encoding\",\n        \"label\": \"Confirmed source encoding\",\n        \"value\": \"Compare only\",\n        \"type\": \"select\",\n        \"values\": [\n          \"Compare only\",\n          \"utf-8\",\n          \"windows-1252\",\n          \"utf-16le\",\n          \"utf-16be\",\n          \"shift_jis\"\n        ]\n      },\n      {\n        \"key\": \"confirmEncoding\",\n        \"label\": \"I reviewed the candidate text and confirm this encoding\",\n        \"value\": false,\n        \"type\": \"checkbox\"\n      },\n      {\n        \"key\": \"allowReplacement\",\n        \"label\": \"Allow replacement characters and possible data loss\",\n        \"value\": false,\n        \"type\": \"checkbox\",\n        \"help\": \"Required if the selected decoding has malformed bytes or U+FFFD characters. Replacement counts include any literal U+FFFD characters already present in the source.\"\n      },\n      {\n        \"key\": \"bom\",\n        \"label\": \"Add UTF-8 BOM to the exported CSV\",\n        \"value\": false,\n        \"type\": \"checkbox\"\n      },\n      {\n        \"key\": \"exportMode\",\n        \"label\": \"Spreadsheet formula handling\",\n        \"value\": \"Protect formulas\",\n        \"type\": \"select\",\n        \"values\": [\n          \"Protect formulas\",\n          \"Preserve original cells\"\n        ]\n      }\n    ],\n    \"registrationFamily\": \"csv-preparation\",\n    \"presentation\": \"metrics\",\n    \"note\": \"Compare the previews first, then select and confirm the source encoding. The comparison does not identify the correct encoding. Export rewrites the file as quoted UTF-8 CSV; it cannot recover text already lost. Processed on your device. CSV downloads protect spreadsheet formula prefixes by default, which changes affected cells.\",\n    \"files\": true,\n    \"multiple\": false,\n    \"input\": false,\n    \"accept\": \".csv,.tsv,.txt,text/csv,text/plain\",\n    \"maxFileBytes\": 1000000,\n    \"experience\": {\n      \"automatic\": false,\n      \"single\": false,\n      \"inputMaxLength\": 1000000,\n      \"inputMode\": \"text\",\n      \"label\": \"Raw CSV file\",\n      \"placeholder\": \"Choose the original file bytes\",\n      \"help\": \"Compare candidates first. Select and confirm an encoding before creating a UTF-8 CSV. Up to 1,000,000 characters. Review the settings before running.\",\n      \"action\": null\n    },\n    \"mode\": \"explicit\",\n    \"interactive\": false\n  },\n  \"execution\": \"Browser interface\",\n  \"api\": null,\n  \"browser_agent\": {\n    \"supported\": true,\n    \"name\": \"run_current_tool\",\n    \"discovery\": \"WebMCP on the human page in a supporting browser\",\n    \"verification\": \"See audit/API-AUDIT.md; availability is not verification\"\n  }\n}\n```\n\n## Page guide\n\nCompare raw CSV bytes under several character encodings and explicitly confirm a UTF-8 export after reviewing the text.\n\n### How to use CSV encoding repair\n\n1. Choose a raw CSV file and run Compare only.\n2. Review each candidate preview, replacement count, malformed-byte flag and mojibake warnings.\n3. Select the source encoding, confirm your choice and optionally add a UTF-8 BOM before exporting.\n\nHow can we improve this tool?\n\nReport a problem or share an idea.\n\nPlease leave out private information. Your message and the tool name go to our team via PostHog.\n\n## Useful next steps\n\n- [CSV column calculator](https://happytails.ai/en/data-tools/csv-column-calculator/) ([Markdown](https://happytails.ai/en/data-tools/csv-column-calculator.md))\n\n- [CSV anonymizer](https://happytails.ai/en/data-tools/csv-anonymizer/) ([Markdown](https://happytails.ai/en/data-tools/csv-anonymizer.md))\n\n## A preview is not an encoding diagnosis\n\nUTF-8, Windows-1252, UTF-16LE, UTF-16BE and Shift\\_JIS candidates appear in a fixed order. Counts and BOM information are clues, not a confidence ranking. ASCII and many legacy files are ambiguous. No encoding is selected silently and no mojibake text is automatically rewritten.\n\n### Understand conversion and possible loss\n\nThe output reparses CSV and writes quoted comma-separated UTF-8 with CRLF records. Parsed cell strings and quoted multiline content are retained before optional formula protection, while original quoting, delimiters and byte layout change. Malformed bytes or U+FFFD replacement characters require a separate explicit possible-loss permission. Previously lost text cannot be reconstructed.\n\n### Local processing and exact strings\n\nProcessing runs on your device. CSV downloads quote every cell and protect spreadsheet formula prefixes by default, which changes affected strings. Preserve original cells is for trusted machine processing. Import identifiers as text in spreadsheet applications to preserve leading zeros.\n"
}