ForHosting KIT · Developer Utilities

RTF Unicode escaper

café becomes caf\u233?: plain ASCII stays readable, every other character turns into an RTF control word with a signed decimal and a fallback mark, and pasted escapes decode back to real text, emoji included. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
café
Calculation mode
Encode
You get
Result
caf\u233?
Length
9
Code units
4
Escape count
1

Rich Text Format files and clipboard fragments often hide non-ASCII characters behind a distinctive control word: a backslash, the letter u, a signed decimal integer, and usually a one-character ANSI fallback such as a question mark. Support engineers, localization specialists, and developers who paste RTF snippets into tickets need a converter that turns readable text into those control words and turns opaque escapes back into characters without guessing truncated or out-of-range values.

How RTF \uN control words represent Unicode

The RTF specification defines a Unicode destination that inserts one UTF-16 code unit for each backslash-u control word. The number after u is a signed sixteen-bit integer written in decimal: values from zero through 32767 name the matching BMP units directly, while values from negative 32768 through negative one name the upper half of the BMP by two's complement, so unit 65533 appears as negative three.

Immediately after the digits, RTF readers skip a fixed number of ANSI destination characters controlled by backslash-uc; the default of one means a single fallback such as a question mark is consumed and discarded when the reader understands Unicode. Writers therefore emit patterns like caf followed by backslash-u-two-three-three-question-mark for café, leaving ASCII letters literal so the file stays partly human-readable. Characters outside the Basic Multilingual Plane become a high surrogate and a low surrogate as two consecutive control words, often with negative decimals for both halves.

On decode it scans for backslash-u, optional sign, and one to five digits, validates the signed sixteen-bit range, consumes one destination character when present, and recombines valid surrogate pairs into a single scalar so emoji round-trip correctly. Truncated escapes, missing digits, and decimals outside the signed range fail with a clear index instead of inventing a character.

Build CI goldens for RTF writers

Encode product names and accented captions into stable \uN? forms that RTF serializers and mail-merge tests must match after library upgrades.

Teach signed 16-bit RTF Unicode

Show students that high BMP units and emoji surrogates use negative decimals in RTF, unlike JavaScript \uXXXX hex, then decode the pair back to one character.

How do RTF Unicode escapes differ from JavaScript \uXXXX?

RTF uses a signed decimal after \u (for example \u233? for é) and a one-character ANSI fallback.

How do I encode text to RTF \uN form?

Send text with mode encode (the default). ASCII stays literal; each non-ASCII UTF-16 unit becomes \u plus a signed decimal plus the fallback character (default ?).

How do I decode RTF Unicode control words?

Send the escaped string with mode decode. Well-formed \uN sequences become characters; one destination character after each number is consumed when present; surrogate pairs recombine into emoji and other non-BMP scalars.

Why do some RTF Unicode codes have negative numbers?

RTF writes each code as a signed 16-bit number. Values up to 32767 appear as they are, while higher ones wrap into negatives, so the character 65533 is written as -3. The converter applies and reverses that rule for you.

What is the question mark after each \uN code?

It is a fallback character for programs that cannot show Unicode. A reader that understands Unicode skips it, an older one prints it instead. The question mark is the default; you can pick another single character or leave it out.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/enc/rtf-unicode

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/enc/rtf-unicode \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"café"}'
{
  "text": "café"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.rtf_unicode",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Unlike JavaScript or JSON hex escapes that look like backslash-u-zero-zero-e-nine, RTF stores the UTF-16 code unit as a decimal number that may be negative when the unit sits above 32767, so é becomes backslash-u-two-three-three-question-mark and high surrogates for emoji become negative pairs. The free browser tool and the paid API share one deterministic core, so demos, CI checks, and live webhooks always agree at the published price of $0.002 per successful item.

How RTF \uN control words represent Unicode

That design is completely different from Java or JSON four-hex-digit escapes even though both start with backslash-u, which is why people searching for RTF Unicode conversion need a dedicated landing rather than a hex-only tool. This capability walks text by UTF-16 code unit on encode, leaves ASCII below 128 unchanged, and formats every non-ASCII unit as backslash-u, the signed decimal, and your chosen fallback.

What you send and what you get back

Send a required string field named text and an optional mode field set to encode or decode. Encode turns non-ASCII units into contiguous RTF escapes while keeping ASCII readable: café becomes caf plus backslash-u-two-three-three-question-mark, and a string with emoji yields two signed control words for the surrogate pair. Decode reverses the process: it replaces each well-formed backslash-u decimal with the matching code unit, drops the one-character destination when present, keeps literal characters that were never escaped, and recombines high-plus-low pairs into one character. When mode is omitted, encode is the default so a single payload still does useful work. Success responses echo mode, text, and fallback, return result as the primary output string, and include length, code_units for UTF-16 units processed, escape_count for how many control words were produced or consumed, a format label of backslash-u-N-question-mark style, and a short standard note naming RTF Unicode control words. Missing text, unsupported mode values, strings longer than the documented maximum, a fallback longer than one character, truncated numbers after backslash-u, non-digit bodies, and out-of-range signed values all fail with invalid_input and an English message that names the field or index. Validation failures do not consume prepaid balance. Pricing for successful API calls is the published base of $0.002 per item.

Where RTF Unicode conversion shows up in real work

Document migration teams extract legacy .rtf mail merges and help-system topics that still carry product names with accents encoded as decimal control words; decoding those snippets into plain Unicode speeds review without opening a full word processor. Localization QA compares an exported RTF string against a translation memory entry by encoding the expected phrase and asserting byte-stable control words after a library upgrade. If you need JavaScript-style four-hex-digit escapes, raw U-plus code point lists, percent-encoding for URLs, or HTML named entities, treat those as separate search intents and landings—those tools answer different queries even when the underlying string walks are short. Clipboard bridges between older Windows rich-edit controls and modern web apps often leave backslash-u sequences in intermediate JSON logs; support staff paste the fragment into a dedicated RTF Unicode escaper rather than hand-computing two's complement for every unit above 32767. Because this capability is a pure parse engine, API pricing stays at the published base of $0.002 per successful item and failed validation does not consume balance.

Decode RTF clipboard and .rtf fragments

Paste a rich-text snippet full of backslash-u decimal control words, decode to readable Unicode, then re-encode a corrected fixture for the next export.

What happens on a malformed RTF escape?

The task fails with invalid_input and a message that names the index or problem (missing digits, out-of-range signed value, truncated body). Validation failures are not billed.

What does the RTF Unicode escaper cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →