Docs › Language and text
Tamil legacy encodings API
Old Tamil text that shows as accented Latin letters, to Unicode and back.
Before Unicode, Tamil was stored in 8-bit encodings that only looked like Tamil in one particular font; anywhere else the same text shows as characters like ¾Á¢ú. This converts such text to Unicode and Unicode back to it, moving the vowel signs that those encodings write before the consonant. TSCII 1.7 is offered now; TAB, TAM and Bamini are planned. The tables are written from the published standard.
Convert Tamil text
GET/v1/tamil-font/convertPOST
Give the text as it looks without its font (the Windows-1252 characters), or POST the raw bytes as application/octet-stream. Converting to an 8-bit encoding answers with the same kind of text, and with the bytes in base64. Bytes the encoding does not assign are counted in undefined; characters it has no code for are listed in unmapped.
Also takes POST: The text, or with Content-Type application/octet-stream the raw bytes. Send it as text/plain, or as JSON {"text": "..."} with the other options beside it, up to 256 KB.
What you send here is never written to the log, and the answer is not cached.
| Parameter | Description |
|---|---|
textquery | The text (or POST it). |
fromquery, required | What the text is in. One of: unicode, tscii. |
toquery | What to convert to. Default unicode; one of from and to must be unicode. One of: unicode, tscii. |
curl
curl "https://api.dharun.dev/v1/tamil-font/convert?from=tscii&text=%C2%BE%C3%81%C2%A2%C3%BA+%C3%85%C2%BD%C3%AC%C2%B8%C3%B5"JavaScript
const response = await fetch("https://api.dharun.dev/v1/tamil-font/convert?from=tscii&text=%C2%BE%C3%81%C2%A2%C3%BA+%C3%85%C2%BD%C3%AC%C2%B8%C3%B5");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);Python
import requests
response = requests.get("https://api.dharun.dev/v1/tamil-font/convert?from=tscii&text=%C2%BE%C3%81%C2%A2%C3%BA+%C3%85%C2%BD%C3%AC%C2%B8%C3%B5", timeout=10)
body = response.json()
if not response.ok:
raise RuntimeError(body["error"]["message"])
print(body["data"])Response
{
"data": {
"from": "tscii",
"to": "unicode",
"text": "தமிழ் வணக்கம்"
},
"meta": {}
}Encodings offered
GET/v1/tamil-font/encodings
The encodings that can be converted, with fonts that use each, to help recognise what a text is in.
curl
curl "https://api.dharun.dev/v1/tamil-font/encodings"JavaScript
const response = await fetch("https://api.dharun.dev/v1/tamil-font/encodings");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);Python
import requests
response = requests.get("https://api.dharun.dev/v1/tamil-font/encodings", timeout=10)
body = response.json()
if not response.ok:
raise RuntimeError(body["error"]["message"])
print(body["data"])Response, with lists and long text shortened
{
"data": [
{
"id": "tscii",
"name": "TSCII 1.7",
"about": "Tamil Script Code for Information Interchange: most Tamil web pages and mail from 1997 to the mid-2000s, and the Project Madurai library.",
"fonts": [
"TSCu_Paranar",
"TSCu_InaimathiTSC",
"TSC_Avarangal"
]
}
],
"meta": {
"note": "Convert with /v1/tamil-font/convert, from or to any of these and unicode."
}
}Using an AI assistant? Connect the MCP server and it can call this API by itself.