{"uid":"cap_RDGOuAKFyJxnqGduxySa-","slug":"irantools-encoding-detection-71bdfc23","name":"IranTools Encoding Detection","description":"Persian and Iranian utilities for AI agents, plus general text/Unicode tooling. Jalali (Solar Hijri) calendar conversion, Iranian national ID / SHEBA / bank card / postal code / economic code validation, province and city lookup, official public holidays, Persian text normalization, keyword extraction, sentence splitting, similarity, HTML stripping, RTL fixing, Unicode homoglyph folding, script detection, NFC/NFD normalization, grapheme counting, date description, business-day counting, slugify, FNV-1a hashing, Shannon entropy, format and encoding detection, byte sizes. Pay per call in USDC on Base via x402 - no signup, no API key, no KYC. The same tools are also exposed as MCP tools at /mcp.","url":"https://irantools.johnaio281.workers.dev/api/iran/detect_encoding?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["bytes"],"properties":{"bytes":{"type":"string"}}},"responseSchema":{"type":"object","additionalProperties":true},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_9nRR9cC0XMd5tQ7ooFUWU","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Detects the character encoding of a given byte sequence (e.g., UTF-8, ISO-8859-1, Windows-1256)","exampleAgentPrompt":"Can you detect the encoding of these raw bytes so I know how to decode them before processing the Persian text: 'SGVsbG8gV29ybGQ='?","exampleUseCases":[{"title":"Decoding legacy Iranian documents","prompt":"I have raw bytes from an old Iranian government PDF and I'm not sure if it's Windows-1256 or UTF-8 — can you detect the encoding of these bytes so I can decode them properly: '2K/2l9mI2YU='?"},{"title":"Fixing garbled Persian web scrape","prompt":"I scraped some Persian text from a website and it came out garbled. Here are the raw bytes — can you tell me what encoding they are so I can re-decode them correctly: 'uPolitics Persian bytes here'?"},{"title":"Pre-processing multilingual email content","prompt":"Before I normalize this Persian email body, I need to know its encoding. Can you detect the charset for these bytes from the email: 'xyzABCbytes'?"}],"resultDescription":"Returns a JSON object indicating the detected encoding name (e.g., UTF-8, ISO-8859-1, Windows-1256, CP1256) along with likely confidence or metadata about the detection result.","failureModes":["Missing or empty 'bytes' field returns a validation error","Ambiguous byte sequences may return low-confidence or multiple candidate encodings","Very short byte inputs may not provide enough signal for accurate detection","Non-base64 or malformed byte strings may cause parsing errors","Extremely rare encodings may not be recognized"],"whenToPreferThis":"Use this endpoint when you need to identify the character encoding of raw bytes, especially for Persian, Arabic, or other Middle Eastern text that may use Windows-1256, CP1256, or similar legacy encodings. It is part of a broader IranTools suite and is particularly well-suited for pipelines that process Iranian documents, legacy files, or scraped Persian web content before normalization or Unicode conversion.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:41:49.826Z","isFirstParty":false,"canonicalSlug":"irantools-encoding-detection-71bdfc23"}