skip to Main Content

I have an unusual text, how to convert it to normal text with javascript?

Nicknames, cool fonts, symbols and stylish names for Aulia – A u l i a ✿, ꧁a u l i a |ᴳᴵᴿᴸ꧂, aulia...✿, Auliaᴮᴱᴮᴬᴺ ♕, ᴬᵁᴸᴵᴬ ...

Please help me.

2

Answers


  1. There are a number of options for “normal” text. As mentioned by Tim, they are just Unicode characters. You have options, both require to retrieve the codepoint of each character one by one:

    • check value and drop anything above ASCII (that’s 255 AFAIK). You will loose data.

    • build a lookup table with lookalike character. Use this for starters. If your codepoint is > 255, do a lookup and replace if found. Otherwise drop

    • same as before, but retain the unknowns.

    • finally (tongue in cheek). Make peace with Unicode. It is very inclusive

    Login or Signup to reply.
  2. You’re looking for unicode "compatibility normalization":

    test = "Aulia – A u l i a ✿, ꧁a u l i a |ᴳᴵᴿᴸ꧂, aulia...✿, Auliaᴮᴱᴮᴬᴺ ♕, ᴬᵁᴸᴵᴬ ..."
    
    console.log(test.normalize("NFKD"))
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search