{"uid":"cap_1bm8FBNZO-BhxXdieLQWc","slug":"writerslogic-text-offsets-unicode-analysis-4dae623a","name":"WritersLogic Text Offsets & Unicode Analysis","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/text-offsets?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"kind":{"enum":["text","identifier","url"],"type":"string","description":"How the unicode rules treat the string. Default text."},"scan":{"type":"boolean","description":"Run the hidden-Unicode rules. Default true."},"text":{"type":"string","maxLength":50000,"minLength":0,"description":"The string."},"ranges":{"type":"array","items":{"type":"object","required":["unit","start","end"],"properties":{"end":{"type":"integer","maximum":10000000,"minimum":0},"unit":{"enum":["utf16","codePoint","utf8","grapheme"],"type":"string"},"start":{"type":"integer","maximum":10000000,"minimum":0}},"additionalProperties":false},"maxItems":200,"description":"Half-open ranges to convert; each is read in its own unit."}}},"responseSchema":{"type":"json"},"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_i-d6dmibXSlzKwMpDcdnO","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":"Analyzes a string's length in all four Unicode encoding units (UTF-16, code points, UTF-8 bytes, grapheme clusters), converts ranges between those units, and scans for hidden/dangerous Unicode characters including bidi controls, confusables, and invisible characters.","exampleAgentPrompt":"Can you analyze this string '👨‍👩‍👧‍👦 café' and tell me its length in UTF-16 code units, code points, UTF-8 bytes, and grapheme clusters — also scan it for any hidden or dangerous Unicode characters like bidi controls or confusables?","exampleUseCases":[{"title":"Detecting hidden Unicode in user submissions","prompt":"Scan this user-submitted username 'аdmin' for confusable or invisible characters — I want to know if any characters look like ASCII but are actually something else, and get the offsets in all encoding units."},{"title":"Converting editor cursor ranges across encodings","prompt":"I have a range from byte offset 10 to 25 in UTF-8 for the string 'Hello, 世界! 🌍', can you convert that range to UTF-16 code units, Unicode code points, and grapheme clusters?"},{"title":"Validating text security for a code signing pipeline","prompt":"Check this code comment '/* ‮legitimate code ‬*/' for bidi control characters, zero-width characters, or anything that could make it visually deceiving — treat it as an identifier and give me exact positions in all four encoding systems."}],"resultDescription":"Returns an object containing: string length measured in all four encoding systems (UTF-16 code units, Unicode code points, UTF-8 bytes, grapheme clusters), converted representations of each submitted range in all four unit systems with flags if a range boundary falls mid-surrogate-pair, mid-multibyte-UTF-8-sequence, or mid-grapheme, and (when scan=true) a list of Unicode security findings (bidi controls, zero-width/invisible characters, tag characters, confusables) each with offsets in all four systems. Also reports BOM presence, line-ending style, normalization form (NFC/NFD), and unpaired surrogates.","failureModes":["Text exceeds 50,000 character limit — request rejected","More than 200 ranges submitted — request rejected","Range start or end exceeds 10,000,000 — request rejected","Invalid unit enum value in ranges — validation error","Malformed JSON body — 400 error","Payment not provided or insufficient — 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need precise, multi-encoding-aware string length measurements or range conversions — especially when working with text that may contain emoji, CJK characters, or supplementary plane characters where UTF-16, code point, and grapheme counts diverge significantly. It is the right choice when you need to detect hidden or visually deceptive Unicode (bidi attacks, homoglyph confusables, invisible characters) with exact offset reporting in all encoding systems. Prefer it over generic string libraries when you need ICU-grade grapheme boundary accuracy or normalization-form detection.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:38:59.962Z","isFirstParty":false,"canonicalSlug":"writerslogic-text-offsets-unicode-analysis-4dae623a"}