# WritersLogic Text Offsets & Unicode Analysis

> WritersLogic Text Offsets & Unicode Analysis is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

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.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/text-offsets?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-text-offsets-unicode-analysis-4dae623a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1bm8FBNZO-BhxXdieLQWc

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-text-offsets-unicode-analysis-4dae623a -d '<json body>'
```

Example prompt: 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?

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-text-offsets-unicode-analysis-4dae623a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
