Socket
Socket
Sign inDemoInstall

string-to-unicode-variant

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    string-to-unicode-variant

Javascript function to convert a string into different kind of ⓤⓝⓘⓒⓞⓓⓔ variants.


Version published
Weekly downloads
37
decreased by-37.29%
Maintainers
1
Install size
179 kB
Created
Weekly downloads
 

Readme

Source

𝗎҉ toUnicodeVariant

Javascript function to convert a string into different kind of ⓤⓝⓘⓒⓞⓓⓔ variants.

toUnicodeVariant is an attempt to utilize unicode in a structured, organized and logical manner.

browser
<script src="path/to/toUnicodeVariant.js"></script>
nodejs
const toUnicodeVariant = require('path/to/toUnicodeVariant.js') 
typescript
npm install string-to-unicode-variant
import {string_to_unicode_variant} from "string-to-unicode-variant";
Usage

Pass a string and the name of a variant (or alias), and you get the unicoded' string in return :

toUnicodeVariant(string, variant, combinings)
...
toUnicodeVariant('monospace', 'm') //like first row below 
VariantAliasDescriptionExample
monospacemMonospace𝚖𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎
boldbBold text𝐛𝐨𝐥𝐝
italiciItalic text𝑖𝑡𝑎𝑙𝑖𝑐
bold italicbibold+italic text𝒃𝒐𝒍𝒅 𝒊𝒕𝒂𝒍𝒊𝒄
scriptcHandwriting style𝓈𝒸𝓇𝒾𝓅𝓉
bold scriptbcBolder handwriting𝓫𝓸𝓵𝓭 𝓼𝓬𝓻𝓲𝓹𝓽
gothicgGothic (fraktur)𝔤𝔬𝔱𝔥𝔦𝔠
gothic boldbgGothic in bold𝖌𝖔𝖙𝖍𝖎𝖈 𝖇𝖔𝖑𝖉
doublestruckdOutlined text𝕕𝕠𝕦𝕓𝕝𝕖𝕤𝕥𝕣𝕦𝕔𝕜
𝗌𝖺𝗇𝗌sSans-serif style𝗌𝖺𝗇𝗌
bold 𝗌𝖺𝗇𝗌bsBold sans-serif𝗯𝗼𝗹𝗱 𝘀𝗮𝗻𝘀
italic 𝗌𝖺𝗇𝗌isItalic sans-serif𝘪𝘵𝘢𝘭𝘪𝘤 𝘴𝘢𝘯𝘴
bold italic sansbisBold italic sans-serif𝙗𝙤𝙡𝙙 𝙞𝙩𝙖𝙡𝙞𝙘 𝙨𝙖𝙣𝙨
circledoLetters within circlesⓒⓘⓡⓒⓛⓔⓓ
circled negativeon-- negative🅒🅘🅡🅒🅛🅔🅓
squaredqLetters within squares🅂🅀🅄🄰🅁🄴🄳
squared negativeqn-- negative🆂🆀🆄🅰🆁🅴🅳
paranthesispLetters within paranthesis⒫⒜⒭⒠⒩⒯⒣⒠⒮⒤⒮
fullwidthwWider monospace fontfullwidth
flagsfRegional codes🇩🇰 🇺 🇳 🇮 🇨 🇴 🇩 🇪
numbers dotndNumbers with trailing dot⒈⒉⒊⒋
numbers commancNumbers with trailing comma🄂🄃🄄🄅
number double circledndcNumbers within double circle⓵⓶⓷⓸
romanrRoman numeralsⅠ, Ⅱ, ⅯⅯⅩⅩⅢ

Combining with underline, strike and other diacritical marks

The unicoded' text can be combined with a broad range of diacritical marks

toUnicodeVariant('underlined', 'bold italic', 'underline-double')//𝒖̳𝒏̳𝒅̳𝒆̳𝒓̳𝒍̳𝒊̳𝒏̳𝒆̳𝒅̳

CombiningShortSample (italic variant)
strikes𝑎̶𝑏̶𝑐̶𝑑̶𝑒̶𝑓̶
strike-curlysc𝑎̴𝑏̴𝑐̴𝑑̴𝑒̴𝑓̴
underlineu𝑎̲𝑏̲𝑐̲𝑑̲𝑒̲𝑓̲
underline-curlyuc𝑎̰𝑏̰𝑐̰𝑑̰𝑒̰𝑓̰
underline-smu-sm𝑎̠𝑏̠𝑐̠𝑑̠𝑒̠𝑓̠
underline-doubleud𝑎̳𝑏̳𝑐̳𝑑̳𝑒̳𝑓̳
underline-double-smud-sm𝑎͇𝑏͇𝑐͇𝑑͇𝑒͇𝑓͇
overlineo𝑎̅𝑏̅𝑐̅𝑑̅𝑒̅𝑓̅
overline-curlyoc𝑎̃𝑏̃𝑐̃𝑑̃𝑒̃𝑓̃
overline-smo-sm𝑎̄𝑏̄𝑐̄𝑑̄𝑒̄𝑓̄
overline-doubleod𝑎̿𝑏̿𝑐̿𝑑̿𝑒̿𝑓̿
slashsl𝑎̸𝑏̸𝑐̸𝑑̸𝑒̸𝑓̸
cross-aboveca𝑎̽𝑏̽𝑐̽𝑑̽𝑒̽𝑓̽
plus-belowpb𝑎̟𝑏̟𝑐̟𝑑̟𝑒̟𝑓̟
enclose-circleen-c𝑎⃝ 𝑏⃝ 𝑐⃝ 
enclose-circle-backslashen-cb𝑎⃠ 𝑏⃠ 𝑐⃠ 
enclose-squareen-s𝑎⃞ 𝑏⃞ 𝑐⃞ 
enclose-diamonden-d𝑎⃟ 𝑏⃟ 𝑐⃟ 
enclose-screenen-scr𝑎⃢ 𝑏⃢ 𝑐⃢ 
enclose-keycapen-k𝑎⃣ 𝑏⃣ 𝑐⃣ 
halo-brevehb𝖺҈ 𝖻҈ 𝖼҈ 
halo-gravehg𝖺҉ 𝖻҉ 𝖼҉ 
𝑛-above{a..x}-a𝑎ͣ𝑎ͨ𝑎ͩ𝑎ͤ𝑎ͪ𝑎ͥ𝑎ͫ𝑎ͦ𝑎ͬ𝑎ͧ𝑎ͮ𝑎ͯ
🔎 Compatibility table: Variants / combinings
sscuucu-smudud-smooco-smodsla-ac-ad-ae-ah-ai-am-ar-au-av-ax-acapben-cen-cben-sen-den-scren-khbhg
monospace𝚊̶𝚊̴𝚊̲𝚊̰𝚊̠𝚊̳𝚊͇𝚊̅𝚊̃𝚊̄𝚊̿𝚊̸𝚊ͣ𝚊ͨ𝚊ͩ𝚊ͤ𝚊ͪ𝚊ͥ𝚊ͫ𝚊ͬ𝚊ͧ𝚊ͮ𝚊ͯ𝚊̽𝚊̟𝚊⃝𝚊⃠𝚊⃞𝚊⃟𝚊⃢𝚊⃣ - -
bold𝐚̶𝐚̴𝐚̲𝐚̰𝐚̠𝐚̳𝐚͇𝐚̅𝐚̃𝐚̄𝐚̿𝐚̸𝐚ͣ𝐚ͨ𝐚ͩ𝐚ͤ𝐚ͪ𝐚ͥ𝐚ͫ𝐚ͬ𝐚ͧ𝐚ͮ𝐚ͯ𝐚̽𝐚̟𝐚⃝𝐚⃠𝐚⃞𝐚⃟𝐚⃢𝐚⃣ - -
italic𝑎̶𝑎̴𝑎̲𝑎̰𝑎̠𝑎̳𝑎͇𝑎̅𝑎̃𝑎̄𝑎̿𝑎̸𝑎ͣ𝑎ͨ𝑎ͩ𝑎ͤ𝑎ͪ𝑎ͥ𝑎ͫ𝑎ͬ𝑎ͧ𝑎ͮ𝑎ͯ𝑎̽𝑎̟𝑎⃝𝑎⃠𝑎⃞𝑎⃟𝑎⃢𝑎⃣ - -
bold italic𝒂̶𝒂̴𝒂̲𝒂̰𝒂̠𝒂̳𝒂͇𝒂̅𝒂̃𝒂̄𝒂̿𝒂̸𝒂ͣ𝒂ͨ𝒂ͩ𝒂ͤ𝒂ͪ𝒂ͥ𝒂ͫ𝒂ͬ𝒂ͧ𝒂ͮ𝒂ͯ𝒂̽𝒂̟𝒂⃝𝒂⃠𝒂⃞𝒂⃟𝒂⃢𝒂⃣ - -
script𝒶̶𝒶̴𝒶̲𝒶̰𝒶̠𝒶̳𝒶͇𝒶̅𝒶̃𝒶̄𝒶̿𝒶̸𝒶ͣ𝒶ͨ𝒶ͩ𝒶ͤ𝒶ͪ𝒶ͥ𝒶ͫ𝒶ͬ𝒶ͧ𝒶ͮ𝒶ͯ𝒶̽𝒶̟𝒶⃝𝒶⃠𝒶⃞𝒶⃟𝒶⃢𝒶⃣ - -
bold script𝓪̶𝓪̴𝓪̲𝓪̰𝓪̠𝓪̳𝓪͇𝓪̅𝓪̃𝓪̄𝓪̿𝓪̸𝓪ͣ𝓪ͨ𝓪ͩ𝓪ͤ𝓪ͪ𝓪ͥ𝓪ͫ𝓪ͬ𝓪ͧ𝓪ͮ𝓪ͯ𝓪̽𝓪̟𝓪⃝𝓪⃠𝓪⃞𝓪⃟𝓪⃢𝓪⃣ - -
gothic𝔞̶𝔞̴𝔞̲𝔞̰𝔞̠𝔞̳𝔞͇𝔞̅𝔞̃𝔞̄𝔞̿𝔞̸𝔞ͣ𝔞ͨ𝔞ͩ𝔞ͤ𝔞ͪ𝔞ͥ𝔞ͫ𝔞ͬ𝔞ͧ𝔞ͮ𝔞ͯ𝔞̽𝔞̟𝔞⃝𝔞⃠𝔞⃞𝔞⃟𝔞⃢𝔞⃣ - -
gothic bold𝖆̶𝖆̴𝖆̲𝖆̰𝖆̠𝖆̳𝖆͇𝖆̅𝖆̃𝖆̄𝖆̿𝖆̸𝖆ͣ𝖆ͨ𝖆ͩ𝖆ͤ𝖆ͪ𝖆ͥ𝖆ͫ𝖆ͬ𝖆ͧ𝖆ͮ𝖆ͯ𝖆̽𝖆̟𝖆⃝𝖆⃠𝖆⃞𝖆⃟𝖆⃢𝖆⃣ - -
doublestruck𝕒̶𝕒̴𝕒̲𝕒̰𝕒̠𝕒̳𝕒͇𝕒̅𝕒̃𝕒̄𝕒̿𝕒̸ - - - - - - - - - - - 𝕒̽𝕒̟ - - - - - - 𝕒҈𝕒҉
sans𝖺̶𝖺̴𝖺̲𝖺̰𝖺̠𝖺̳𝖺͇𝖺̅𝖺̃𝖺̄𝖺̿𝖺̸ - - - - - - - - - - - 𝖺̽𝖺̟ - - - - - - 𝖺҈𝖺҉
bold sans𝗮̶𝗮̴𝗮̲𝗮̰𝗮̠𝗮̳𝗮͇𝗮̅𝗮̃𝗮̄𝗮̿𝗮̸ - - - - - - - - - - - 𝗮̽𝗮̟ - - - - - - - -
italic sans𝘢̶𝘢̴𝘢̲𝘢̰𝘢̠𝘢̳𝘢͇𝘢̅𝘢̃𝘢̄𝘢̿𝘢̸ - - - - - - - - - - - 𝘢̽𝘢̟ - - - - - - - -
bold italic sans𝙖̶𝙖̴𝙖̲𝙖̰𝙖̠𝙖̳𝙖͇𝙖̅𝙖̃𝙖̄𝙖̿𝙖̸ - - - - - - - - - - - 𝙖̽𝙖̟ - - - - - - - -
parenthe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
squared - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
squared neg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
circled - - - - - - - - - ⓐ̄ - - - - - - - - - - - - - - - - - - - - - - -
circled neg. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fullwidth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

You can control the space between each character by using space-combinings. In the above table, rendering of the halo- and enclose- samples are used along with a space-en to make them look nicer.

🔎 Compatibility table: Combining spaces
space-zerospace-hairspace-thinspacespace-enspace-figurespace-cjkspace-emspace-ogham
monospace𝚊𝚣𝚊 𝚣 𝚊 𝚣 𝚊 𝚣 𝚊 𝚣 𝚊 𝚣 𝚊 𝚣 𝚊 𝚣 𝚊 𝚣 
bold𝐚𝐳𝐚 𝐳 𝐚 𝐳 𝐚 𝐳 𝐚 𝐳 𝐚 𝐳 𝐚 𝐳 𝐚 𝐳 𝐚 𝐳 
italic𝑎𝑧𝑎 𝑧 𝑎 𝑧 𝑎 𝑧 𝑎 𝑧 𝑎 𝑧 𝑎 𝑧 𝑎 𝑧 𝑎 𝑧 
bold italic𝒂𝒛𝒂 𝒛 𝒂 𝒛 𝒂 𝒛 𝒂 𝒛 𝒂 𝒛 𝒂 𝒛 𝒂 𝒛 𝒂 𝒛 
script𝒶𝓏𝒶 𝓏 𝒶 𝓏 𝒶 𝓏 𝒶 𝓏 𝒶 𝓏 𝒶 𝓏 𝒶 𝓏 𝒶 𝓏 
bold script𝓪𝔃𝓪 𝔃 𝓪 𝔃 𝓪 𝔃 𝓪 𝔃 𝓪 𝔃 𝓪 𝔃 𝓪 𝔃 𝓪 𝔃 
gothic𝔞𝔷𝔞 𝔷 𝔞 𝔷 𝔞 𝔷 𝔞 𝔷 𝔞 𝔷 𝔞 𝔷 𝔞 𝔷 𝔞 𝔷 
gothic bold𝖆𝖟𝖆 𝖟 𝖆 𝖟 𝖆 𝖟 𝖆 𝖟 𝖆 𝖟 𝖆 𝖟 𝖆 𝖟 𝖆 𝖟 
doublestruck𝕒𝕫𝕒 𝕫 𝕒 𝕫 𝕒 𝕫 𝕒 𝕫 𝕒 𝕫 𝕒 𝕫 𝕒 𝕫 𝕒 𝕫 
sans𝖺𝗓𝖺 𝗓 𝖺 𝗓 𝖺 𝗓 𝖺 𝗓 𝖺 𝗓 𝖺 𝗓 𝖺 𝗓 𝖺 𝗓 
bold sans𝗮𝘇𝗮 𝘇 𝗮 𝘇 𝗮 𝘇 𝗮 𝘇 𝗮 𝘇 𝗮 𝘇 𝗮 𝘇 𝗮 𝘇 
italic sans𝘢𝘻𝘢 𝘻 𝘢 𝘻 𝘢 𝘻 𝘢 𝘻 𝘢 𝘻 𝘢 𝘻 𝘢 𝘻 𝘢 𝘻 
bold italic sans𝙖𝙯𝙖 𝙯 𝙖 𝙯 𝙖 𝙯 𝙖 𝙯 𝙖 𝙯 𝙖 𝙯 𝙖 𝙯 𝙖 𝙯 
parenthe⒜⒵⒜ ⒵ ⒜ ⒵ ⒜ ⒵ ⒜ ⒵ ⒜ ⒵ ⒜ ⒵ ⒜ ⒵ ⒜ ⒵ 
squared🄰🅉🄰 🅉 🄰 🅉 🄰 🅉 🄰 🅉 🄰 🅉 🄰 🅉 🄰 🅉 🄰 🅉 
squared neg🅰🆉🅰 🆉 🅰 🆉 🅰 🆉 🅰 🆉 🅰 🆉 🅰 🆉 🅰 🆉 🅰 🆉 
circledⓐⓩⓐ ⓩ ⓐ ⓩ ⓐ ⓩ ⓐ ⓩ ⓐ ⓩ ⓐ ⓩ ⓐ ⓩ ⓐ ⓩ 
circled neg.🅐🅩🅐 🅩 🅐 🅩 🅐 🅩 🅐 🅩 🅐 🅩 🅐 🅩 🅐 🅩 🅐 🅩 
fullwidthaza z a z a z a z a z a z a z a z 
flags🇩🇰🇩 🇰 🇩 🇰 🇩 🇰 🇩 🇰 🇩 🇰 🇩 🇰 🇩 🇰 🇩 🇰 
numbers dot
numbers comma🄂🄃🄂 🄃 🄂 🄃 🄂 🄃 🄂 🄃 🄂 🄃 🄂 🄃 🄂 🄃 🄂 🄃 
numbers dc⓵⓶⓵ ⓶ ⓵ ⓶ ⓵ ⓶ ⓵ ⓶ ⓵ ⓶ ⓵ ⓶ ⓵ ⓶ ⓵ ⓶ 

Combinings can be combined

You can use two, three or more combinings either by passing a comma separated string, or by passing an array of strings :

toUnicodeVariant('The quick brown fox jumps ...', 'sans', 'underline, overline, strike')
toUnicodeVariant('The quick brown fox jumps ...', 'sans', ['underline', 'overline', 'strike'])

𝖳̶̲̅𝗁̶̲̅𝖾̶̲̅ ̶̲̅𝗊̶̲̅𝗎̶̲̅𝗂̶̲̅𝖼̶̲̅𝗄̶̲̅ ̶̲̅𝖻̶̲̅𝗋̶̲̅𝗈̶̲̅𝗐̶̲̅𝗇̶̲̅ ̶̲̅𝖿̶̲̅𝗈̶̲̅𝗑̶̲̅ ̶̲̅𝗃̶̲̅𝗎̶̲̅𝗆̶̲̅𝗉̶̲̅𝗌̶̲̅ ̶̲̅𝗈̶̲̅𝗏̶̲̅𝖾̶̲̅𝗋̶̲̅ ̶̲̅𝗍̶̲̅𝗁̶̲̅𝖾̶̲̅ ̶̲̅𝗅̶̲̅𝖺̶̲̅𝗓̶̲̅𝗒̶̲̅ ̶̲̅𝖽̶̲̅𝗈̶̲̅𝗀̶̲̅

You can use shorthand aliases or a mix, 'u,o,s', ['u','o','strike'] etc.

Special chars

Language specific special chars like ç, ò or ø are not supported by any unicode "variant", and will almost certainly never be in any future. The script and gothic fonts are in fact just various kind of mathematical symbols (see references below). For many of the variants, converting a special char like ø will at best look odd, probably ruin the entire string (vary on reader / browser).

But -- by using the base latin character as fallback, and inject a makeover of diacritical marks, we can experimentally try to mimick some language specific characters. Adding diacritics fails with the figurative variants, but it works okay with most of the rest.

🔎 Table of mimicked special chars, 𝗮̂ to 𝗼̷
#mono spacebolditalic bold italicscriptbold scriptgothicgothic bolddouble strucksansbold sansitalic sansbold italic sans
ä𝚊̈𝐚̈𝑎̈𝚊̈𝒶̈𝓪̈𝔞̈𝖆̈𝕒̈𝖺̈𝗮̈𝘢̈𝙖̈
â𝚊̂𝐚̂𝑎̂𝚊̂𝒶̂𝓪̂𝔞̂𝖆̂𝕒̂𝖺̂𝗮̂𝘢̂𝙖̂
á𝚊́𝐚́𝑎́𝚊́𝒶́𝓪́𝔞́𝖆́𝕒́𝖺́𝗮́𝘢́𝙖́
å𝚊̊𝐚̊𝑎̊𝚊̊𝒶̊𝓪̊𝔞̊𝖆̊𝕒̊𝖺̊𝗮̊𝘢̊𝙖̊
ă𝚊̆𝐚̆𝑎̆𝚊̆𝒶̆𝓪̆𝔞̆𝖆̆𝕒̆𝖺̆𝗮̆𝘢̆𝙖̆
ǟ𝚊̈̄𝐚̈̄𝑎̈̄𝚊̈̄𝒶̈̄𝓪̈̄𝔞̈̄𝖆̈̄𝕒̈̄𝖺̈̄𝗮̈̄𝘢̈̄𝙖̈̄
ã𝚊̃𝐚̃𝑎̃𝚊̃𝒶̃𝓪̃𝔞̃𝖆̃𝕒̃𝖺̃𝗮̃𝘢̃𝙖̃
ā𝚊̄𝐚̄𝑎̄𝚊̄𝒶̄𝓪̄𝔞̄𝖆̄𝕒̄𝖺̄𝗮̄𝘢̄𝙖̄
ȧ𝚊̇𝐚̇𝑎̇𝚊̇𝒶̇𝓪̇𝔞̇𝖆̇𝕒̇𝖺̇𝗮̇𝘢̇𝙖̇
ȃ𝚊̑𝐚̑𝑎̑𝚊̑𝒶̑𝓪̑𝔞̑𝖆̑𝕒̑𝖺̑𝗮̑𝘢̑𝙖̑
𝚋̣𝐛̣𝑏̣𝚋̣𝒷̣𝓫̣𝔟̣𝖇̣𝕓̣𝖻̣𝗯̣𝘣̣𝙗̣
č𝚌̌𝐜̌𝑐̌𝚌̌𝒸̌𝓬̌𝔠̌𝖈̌𝕔̌𝖼̌𝗰̌𝘤̌𝙘̌
ć𝚌́𝐜́𝑐́𝚌́𝒸́𝓬́𝔠́𝖈́𝕔́𝖼́𝗰́𝘤́𝙘́
ċ𝚌̇𝐜̇𝑐̇𝚌̇𝒸̇𝓬̇𝔠̇𝖈̇𝕔̇𝖼̇𝗰̇𝘤̇𝙘̇
𝚌̧́𝐜̧́𝑐̧́𝚌̧́𝒸̧́𝓬̧́𝔠̧́𝖈̧́𝕔̧́𝖼̧́𝗰̧́𝘤̧́𝙘̧́
ç𝚌̧𝐜̧𝑐̧𝚌̧𝒸̧𝓬̧𝔠̧𝖈̧𝕔̧𝖼̧𝗰̧𝘤̧𝙘̧
ċ𝚌̇𝐜̇𝑐̇𝚌̇𝒸̇𝓬̇𝔠̇𝖈̇𝕔̇𝖼̇𝗰̇𝘤̇𝙘̇
ĉ𝚌̂𝐜̂𝑐̂𝚌̂𝒸̂𝓬̂𝔠̂𝖈̂𝕔̂𝖼̂𝗰̂𝘤̂𝙘̂
è𝚎̀𝐞̀𝑒̀𝚎̀𝓮̀𝓮̀𝔢̀𝖊̀𝕖̀𝖾̀𝗲̀𝘦̀𝙚̀
é𝚎́𝐞́𝑒́𝚎́𝓮́𝓮́𝔢́𝖊́𝕖́𝖾́𝗲́𝘦́𝙚́
ē𝚎̄𝐞̄𝑒̄𝚎̄𝓮̄𝓮̄𝔢̄𝖊̄𝕖̄𝖾̄𝗲̄𝘦̄𝙚̄
ĕ𝚎̆𝐞̆𝑒̆𝚎̆𝓮̆𝓮̆𝔢̆𝖊̆𝕖̆𝖾̆𝗲̆𝘦̆𝙚̆
ë𝚎̈𝐞̈𝑒̈𝚎̈𝓮̈𝓮̈𝔢̈𝖊̈𝕖̈𝖾̈𝗲̈𝘦̈𝙚̈
ě𝚎̌𝐞̌𝑒̌𝚎̌𝓮̌𝓮̌𝔢̌𝖊̌𝕖̌𝖾̌𝗲̌𝘦̌𝙚̌
ê𝚎̂𝐞̂𝑒̂𝚎̂𝓮̂𝓮̂𝔢̂𝖊̂𝕖̂𝖾̂𝗲̂𝘦̂𝙚̂
ę𝚎̨𝐞̨𝑒̨𝚎̨𝓮̨𝓮̨𝔢̨𝖊̨𝕖̨𝖾̨𝗲̨𝘦̨𝙚̨
ȇ𝚎̑𝐞̑𝑒̑𝚎̑𝓮̑𝓮̑𝔢̑𝖊̑𝕖̑𝖾̑𝗲̑𝘦̑𝙚̑
ȅ𝚎̏𝐞̏𝑒̏𝚎̏𝓮̏𝓮̏𝔢̏𝖊̏𝕖̏𝖾̏𝗲̏𝘦̏𝙚̏
ğ𝚐̆𝐠̆𝑔̆𝚐̆𝓰̆𝓰̆𝔤̆𝖌̆𝕘̆𝗀̆𝗴̆𝘨̆𝙜̆
ǧ𝚐̌𝐠̌𝑔̌𝚐̌𝓰̌𝓰̌𝔤̌𝖌̌𝕘̌𝗀̌𝗴̌𝘨̌𝙜̌
ģ𝚐̧𝐠̧𝑔̧𝚐̧𝓰̧𝓰̧𝔤̧𝖌̧𝕘̧𝗀̧𝗴̧𝘨̧𝙜̧
ġ𝚐̇𝐠̇𝑔̇𝚐̇𝓰̇𝓰̇𝔤̇𝖌̇𝕘̇𝗀̇𝗴̇𝘨̇𝙜̇
𝚑̣𝐡̣ℎ̣𝚑̣𝒽̣𝓱̣𝔥̣𝖍̣𝕙̣𝗁̣𝗵̣𝘩̣𝙝̣
ĩ𝚒̃𝐢̃𝑖̃𝚒̃𝒾̃𝓲̃𝔦̃𝖎̃𝕚̃𝗂̃𝗶̃𝘪̃𝙞̃
î𝚒̂𝐢̂𝑖̂𝚒̂𝒾̂𝓲̂𝔦̂𝖎̂𝕚̂𝗂̂𝗶̂𝘪̂𝙞̂
í𝚒́𝐢́𝑖́𝚒́𝒾́𝓲́𝔦́𝖎́𝕚́𝗂́𝗶́𝘪́𝙞́
ì𝚒̀𝐢̀𝑖̀𝚒̀𝒾̀𝓲̀𝔦̀𝖎̀𝕚̀𝗂̀𝗶̀𝘪̀𝙞̀
𝚔́𝐤́𝑘́𝚔́𝓀́𝓴́𝔨́𝖐́𝕜́𝗄́𝗸́𝘬́𝙠́
𝚔̣𝐤̣𝑘̣𝚔̣𝓀̣𝓴̣𝔨̣𝖐̣𝕜̣𝗄̣𝗸̣𝘬̣𝙠̣
ņ𝚗̨𝐧̨𝑛̨𝚗̨𝓃̨𝓷̨𝔫̨𝖓̨𝕟̨𝗇̨𝗻̨𝘯̨𝙣̨
ń𝚗́𝐧́𝑛́𝚗́𝓃́𝓷́𝔫́𝖓́𝕟́𝗇́𝗻́𝘯́𝙣́
ñ𝚗𝐧𝑛𝚗𝓃𝓷𝔫𝖓𝕟𝗇𝗻𝘯𝙣
õ𝚘̃𝐨̃𝑜̃𝚘̃𝓸̃𝓸̃𝔬̃𝖔̃𝕠̃𝗈̃𝗼̃𝘰̃𝙤̃
ö𝚘̈𝐨̈𝑜̈𝚘̈𝓸̈𝓸̈𝔬̈𝖔̈𝕠̈𝗈̈𝗼̈𝘰̈𝙤̈
ō𝚘̄𝐨̄𝑜̄𝚘̄𝓸̄𝓸̄𝔬̄𝖔̄𝕠̄𝗈̄𝗼̄𝘰̄𝙤̄
ô𝚘̂𝐨̂𝑜̂𝚘̂𝓸̂𝓸̂𝔬̂𝖔̂𝕠̂𝗈̂𝗼̂𝘰̂𝙤̂
ó𝚘́𝐨́𝑜́𝚘́𝓸́𝓸́𝔬́𝖔́𝕠́𝗈́𝗼́𝘰́𝙤́
ò𝚘̀𝐨̀𝑜̀𝚘̀𝓸̀𝓸̀𝔬̀𝖔̀𝕠̀𝗈̀𝗼̀𝘰̀𝙤̀
ŕ𝚛́𝐫́𝑟́𝚛́𝓇́𝓻́𝔯́𝖗́𝕣́𝗋́𝗿́𝘳́𝙧́
ş𝚜̧𝐬̧𝑠̧𝚜̧𝓈̧𝓼̧𝔰̧𝖘̧𝕤̧𝗌̧𝘀̧𝘴̧𝙨̧
ș𝚜̦𝐬̦𝑠̦𝚜̦𝓈̦𝓼̦𝔰̦𝖘̦𝕤̦𝗌̦𝘀̦𝘴̦𝙨̦
𝚜̣̇𝐬̣̇𝑠̣̇𝚜̣̇𝓈̣̇𝓼̣̇𝔰̣̇𝖘̣̇𝕤̣̇𝗌̣̇𝘀̣̇𝘴̣̇𝙨̣̇
š𝚜̌𝐬̌𝑠̌𝚜̌𝓈̌𝓼̌𝔰̌𝖘̌𝕤̌𝗌̌𝘀̌𝘴̌𝙨̌
ś𝚜́𝐬́𝑠́𝚜́𝓈́𝓼́𝔰́𝖘́𝕤́𝗌́𝘀́𝘴́𝙨́
ü𝚞̈𝐮̈𝑢̈𝚞̈𝓊̈𝓾̈𝔲̈𝖚̈𝕦̈𝗎̈𝘂̈𝘶̈𝙪̈
ù𝚞̀𝐮̀𝑢̀𝚞̀𝓊̀𝓾̀𝔲̀𝖚̀𝕦̀𝗎̀𝘂̀𝘶̀𝙪̀
ú𝚞́𝐮́𝑢́𝚞́𝓊́𝓾́𝔲́𝖚́𝕦́𝗎́𝘂́𝘶́𝙪́
û𝚞̂𝐮̂𝑢̂𝚞̂𝓊̂𝓾̂𝔲̂𝖚̂𝕦̂𝗎̂𝘂̂𝘶̂𝙪̂
ŭ𝚞̆𝐮̆𝑢̆𝚞̆𝓊̆𝓾̆𝔲̆𝖚̆𝕦̆𝗎̆𝘂̆𝘶̆𝙪̆
ȕ𝚞̏𝐮̏𝑢̏𝚞̏𝓊̏𝓾̏𝔲̏𝖚̏𝕦̏𝗎̏𝘂̏𝘶̏𝙪̏
ȗ𝚞̑𝐮̑𝑢̑𝚞̑𝓊̑𝓾̑𝔲̑𝖚̑𝕦̑𝗎̑𝘂̑𝘶̑𝙪̑
ů𝚞̊𝐮̊𝑢̊𝚞̊𝓊̊𝓾̊𝔲̊𝖚̊𝕦̊𝗎̊𝘂̊𝘶̊𝙪̊
ū𝚞̄𝐮̄𝑢̄𝚞̄𝓊̄𝓾̄𝔲̄𝖚̄𝕦̄𝗎̄𝘂̄𝘶̄𝙪̄
𝚠̀𝐰̀𝑤̀𝚠̀𝓌̀𝔀̀𝔴̀𝖜̀𝕨̀𝗐̀𝘄̀𝘸̀𝙬̀
𝚠́𝐰́𝑤́𝚠́𝓌́𝔀́𝔴́𝖜́𝕨́𝗐́𝘄́𝘸́𝙬́
ø𝚘̷𝐨̷𝑜̷𝚘̷𝓸̷𝓸̷𝔬̷𝖔̷𝕠̷𝗈̷𝗼̷𝘰̷𝙤̷

All capital letters are turned into their latin root. Diacritical marks looks silly on most of them. Only in rare cases mimicking a capital letter ends up in a readable entity.
toUnicodeVariant('üničode', 'bold italic') //𝒖̈𝒏𝒊𝒄̌𝒐𝒅𝒆
toUnicodeVariant('ÜNIĈODE', 'bold italic') //𝑼𝑵𝑰𝑪𝑶𝑫𝑬

🔎 Overall support of numbers, special chars, small letters and diacritics
NumbersSmall lettersSpecial charsDiacritics
monospace 𝟷𝚊𝚌̧𝚌̶̧
bold 𝟏𝐚𝐜̧𝐜̶̧
italic -𝑎𝑐̧𝑐̶̧
bold italic -𝒂𝒄̧𝒄̶̧
script -𝒶𝒸̧𝒸̶̧
bold script -𝓪𝓬̧𝓬̶̧
gothic -𝔞𝔠̧𝔠̶̧
gothic bold -𝖆𝖈̧𝖈̶̧
doublestruck 𝟙𝕒𝕔̧𝕔̶̧
sans 𝟣𝖺𝖼̧𝖼̶̧
bold sans 𝟭𝗮𝗰̧𝗰̶̧
italic sans -𝘢𝘤̧𝘤̶̧
bold italic sans -𝙖𝙘̧𝙘̶̧
parenthesis--
squared - - --
squared negative - - --
circled--
circled negative - - --
fullwidth--
flags - - --
numbers dot - --
numbers comma 🄂 - --
numbers double circled - --

Additions, limitations

Besides the limitations you can see in the various compatibility tables above, some variants offers extra unique features - other variants are reduced to one single feature alone.

  • 🄰 squared, qSupports a mixed collection of terms and abbreviations, rendered as one unicode entity: SOS, WC, 4K etc
    🅊 🅋 🅌 🅍 🅎 🅏 🆑 🆒 🆓 🆔 🆕 🆖 🆗 🆘 🆙 🆚 🆛 🆜 🆝 🆞 🆟 🆠 🆡 🆢 🆣 🆤 🄳
  • 🅰 squared negative, qnA,B,O are in some readers rendered as blood type A,B,O. Support a few abbreviations, rendered as one unicode entity: IC, PA, SA, AB, WC
    🆋 🆌 🆍 🆎 🆏
  • 🄐 paranthesis, pNo support of 0, but support numbers 10-20
    ⑽ ⑾ ⑿ ⒀ ⒁ ⒂ ⒃ ⒄ ⒅ ⒆ ⒇
  • Ⓐ circled, oSupport numbers 10-20
    ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳
  • 🅐 circled negative, onLack support of small numbers 1-9 (fallbacks to circled numbers), but support numbers 11-20
    ⓫ ⓬ ⓭ ⓮ ⓯ ⓰ ⓱ ⓲ ⓳ ⓴
  • A fullwidth, wSupport basic symbols like @ and %; support a few extended ASCII codes as well
    ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ \ [ ] ^ _ ` { | } ~ ⦅ ⦆ ¢ £ ¦ ¥ ₩ ー ー 、 ・  ̄ ¬
  • 🄀 numbers dot, ndOnly numbers, additional support of 10-20. Fallbacks to monospace. Does not support any of the space-combinings
    🄀 ⒈ ⒉ ⒊ ⒋ ⒌ ⒍ ⒎ ⒏ ⒐ ⒒ ⒓ ⒔ ⒕ ⒖ ⒗ ⒘ ⒙ ⒚ ⒛
  • 🄁 numbers comma, ncOnly numbers, supports 0-9 only. Fallbacks to monospace
    🄁 🄂 🄃 🄄 🄅 🄆 🄇 🄈 🄉 🄊
  • ⓵ numbers double circled, ndcOnly numbers, does not support 0, supports 10. Fallbacks to monospace
    ⓵ ⓶ ⓷ ⓸ ⓹ ⓺ ⓻ ⓼ ⓽ ⓾
  • Ⅻ roman, rRoman numerals only, supports both small and capital letters. Are converted to best fit of the following numeral sequenzes
    Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ Ⅼ Ⅽ Ⅾ

Ⅻ roman, continued

If you pass a number (integer) instead of a string, that number will be romanized automatically before converting to unicode

 toUnicodeVariant(2023, 'roman') //ⅯⅯⅩⅩⅢ

flags, f

az-AZ only. Based on the highly special regional indicator symbols (see references below, U1F100.pdf). Using that you'll need to pass a string with whitespace between each character (otherwise expect weird output, there is no fallback to monospace) :

toUnicodeVariant('U N I C O D E', 'f') //🇺 🇳 🇮 🇨 🇴 🇩 🇪

However, if you pass a string that contain a country code, or even the name of some international organization, many readers will render the corresponding flag instead :

toUnicodeVariant('DK EU UN', 'flags') //🇩🇰 🇪🇺 🇺🇳

Reset a unicoded' string

Use String.normalize()

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize

'𝖆𝖇𝖈𝖉𝖊𝖋𝖌𝖍𝖎𝖏𝖐𝖑𝖒𝖓𝖔𝖕𝖖𝖗𝖘𝖙𝖚𝖛𝖜𝖝𝖞𝖟'.normalize('NFKC') //or NFKD

returns abcdefghijklmnopqrstuvwxyz

Test

Browser: test/browser.html Node: test$ node node.js

These tests show all variants and their coverage az-AZ-09, along with flag combinations For reference, in Chrome (Ubuntu 20.04, 112.x) variants looks like this :

-- Or you can review a sample output, test/result-sample.html.txt. Try it out in different browsers - there are significant difference in coverage.

References

https://www.unicode.org/charts/PDF/UFF00.pdf
https://www.unicode.org/charts/PDF/U1F100.pdf
https://www.unicode.org/charts/PDF/U1D400.pdf
https://www.unicode.org/charts/PDF/U2150.pdf
https://www.unicode.org/charts/PDF/U2460.pdf
https://www.unicode.org/charts//PDF/Unicode-3.2/U32-2000.pdf
https://www.unicode.org/charts//PDF/Unicode-4.0/U40-0300.pdf

Playground

For now, visit https://detfrieord.dk/tekst-til-unicode (in danish, sorry)

Keywords

FAQs

Last updated on 23 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc