weird-to-normal-chars

Convert weird chars to normal

Usage no npm install needed!

<script type="module">
  import weirdToNormalChars from 'https://cdn.skypack.dev/weird-to-normal-chars';
</script>

README

Weird to normal chars converter

Coverage Status Maintainability npm Donate

NPM

Library to detect weird characters in a string and convert them to normal chars. This project was born to convert biographies in social medias that are sometimes written using weird special characters and fonts, πŸ„»πŸ„ΈπŸ„ΊπŸ„΄ β“£β“—β“˜β“’ πŸ…ΎπŸ…½πŸ…΄.

I mostly used instafonts.io to find the weird chars.

Install

npm i weird-to-normal-chars

Example

const { weirdToNormalChars } = require('weird-to-normal-chars');

const result1 = weirdToNormalChars('𝔗π”₯𝔦𝔰 𝔦𝔰 π”ž 𝔴𝔒𝔦𝔯𝔑 𝔰𝔱𝔯𝔦𝔫𝔀');
const result2 = weirdToNormalChars('π’―π’½π’Ύπ“ˆ π’Ύπ“ˆ 𝒢 π“Œπ‘’π’Ύπ“‡π’Ή π“ˆπ“‰π“‡π’Ύπ“ƒπ‘”');
const result3 = weirdToNormalChars('π•‹π•™π•šπ•€ π•šπ•€ 𝕒 π•¨π•–π•šπ•£π•• 𝕀π•₯π•£π•šπ•Ÿπ•˜');
console.log(result1); // This is a weird string
console.log(result2); // This is a weird string
console.log(result3); // This is a weird string

Run tests

npm test

Run lint

npm run lint

I need you

To support as many chars as possible I need your help. If you have a list of chars that are not covered already, please open an Issue or open a Pull Request.

Author