Scatcode is an experimental character encoding that can support any characters. It supports non-Unicode characters like Sitelen Pona, Tengwar and Liparxe. You can even add your own characters!
See scatcode.gimite.net for an overview and demo.
Scatcode is an extension of Unicode. It abuses a deprecated Unicode feature called language tag, but puts a domain name instead of a language code in the tag. The encoding format is:
U+E0001 [domain-encoded] U+E007F [text]
- Domain Tag Start:
U+E0001signals the beginning of a domain specification - Domain Characters: Each ASCII character in the domain name is encoded by adding
0xE0000to its codepoint- For example:
example.combecomesU+E0065 U+E0078 U+E0061 U+E006D U+E0070 U+E006C U+E0065 U+E002E U+E0063 U+E006F U+E006D - An empty domain name indicates the default (Unicode) domain
- For example:
- Domain Tag End:
U+E007Fsignals the end of domain specification and the start of the actual text - Text Content: The actual text using codepoints defined in the domain
- This often uses codepoints in Unicode Private Use Area, but can be any Unicode codepoints
The text "toki pona" written in Sitelen Pona is encoded into:
U+E0001: LANGUAGE TAG- "sitelenpona.gimite.net" encoded using tag characters (by adding
0xE0000) U+E007F: CANCEL TAGU+F196C: Unicode Private Use Area codepoint for SITELEN PONA IDEOGRAPH TOKIU+F1954: Unicode Private Use Area codepoint for SITELEN PONA IDEOGRAPH PONA
You can also select text in the text area in scatcode.gimite.net and look at the table below to see how it is encoded.
A "domain" of a character set in Scatcode is defined in https://domain/scatcode.json.
See https://sitelenpona.gimite.net/scatcode.json as an example.
Most importantly, /scatcode.json provides a web font in its fallbackFont property. It can be used
to render characters in the domain.
/scatcode.json also provides a list of characters in the domain in its characters property.
/scatcode.json must have a CORS policy to allow access from any domains.
Core library for Scatcode text encoding and parsing. It also provides a web component for displaying Scatcode text.
Usage:
This embeds "toki pona" written in Sitelen Pona in HTML:
<script type="module" src="https://scatcode.gimite.net/scatcode-core-0.1.0.es.js"></script>
<scatcode-text>󠀁󠁳󠁩󠁴󠁥󠁬󠁥󠁮󠁰󠁯󠁮󠁡󠀮󠁧󠁩󠁭󠁩󠁴󠁥󠀮󠁮󠁥󠁴󠁿󱥬󱥔󠀁󠁿</scatcode-text>React component for rendering Scatcode-encoded text.
Installation:
npm install scatcode-textUsage:
This renders "toki pona" written in Sitelen Pona:
import { ScatcodeText } from 'scatcode-text';
function App() {
return (
<ScatcodeText>
󠀁󠁳󠁩󠁴󠁥󠁬󠁥󠁮󠁰󠁯󠁮󠁡󠀮󠁧󠁩󠁭󠁩󠁴󠁥󠀮󠁮󠁥󠁴󠁿󱥬󱥔󠀁󠁿
</ScatcodeText>
);
}React component providing an editable text area for Scatcode-encoded text.
Installation:
npm install scatcode-text-areaUsage:
This shows an editable text area that supports Scatcode-encoded text:
import { ScatcodeTextArea } from 'scatcode-text-area';
function Editor() {
const [content, setContent] = React.useState('');
return (
<ScatcodeTextArea
value={content}
onChange={(value) => setContent(value)}
/>
);
}- Spec of the encoding format and domain configuration: Public domain
scatcode-coreandscatcode-textlibraries: MITscatcode-text-arealibrary andscatcode-demoapp: GPL