An open API service indexing awesome lists of open source software.

https://github.com/DavideViolante/weird-to-normal-chars

Weird to normal chars converter
https://github.com/DavideViolante/weird-to-normal-chars

Last synced: about 18 hours ago
JSON representation

Weird to normal chars converter

Awesome Lists containing this project

README

          

# Weird to normal chars converter
[![](https://github.com/davideviolante/weird-to-normal-chars/workflows/Node.js%20CI/badge.svg)](https://github.com/DavideViolante/weird-to-normal-chars/actions?query=workflow%3A"Node.js+CI") [![Coverage Status](https://coveralls.io/repos/github/DavideViolante/weird-to-normal-chars/badge.svg?branch=master)](https://coveralls.io/github/DavideViolante/weird-to-normal-chars?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/3ab3883e9e0d7faf561d/maintainability)](https://codeclimate.com/github/DavideViolante/weird-to-normal-chars/maintainability) ![npm](https://img.shields.io/npm/dm/weird-to-normal-chars) [![Donate](https://img.shields.io/badge/paypal-donate-179BD7.svg)](https://www.paypal.me/dviolante)

[![NPM](https://nodei.co/npm/weird-to-normal-chars.png)](https://nodei.co/npm/weird-to-normal-chars/)

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](https://instafonts.io) to find the weird chars.

### Install
```
npm i weird-to-normal-chars
```

### Example
```javascript
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
- [Davide Violante](https://github.com/DavideViolante)