简体   繁体   中英

Convert text string to unicode characters in javascript

Lets say I have a text string such as 'hey' and I have a unicode alphabet like Latin Extended-A from wikipedia . How can I map capital A to its similar A in the unicode one. I think I would need to split the english string and have it in the array but then how would it know which letter that is? Is there a library for this?

I believe the answer to this question is here: How do I convert special UTF-8 chars to their iso-8859-1 equivalent using javascript?

so essentially:

decodeURIComponent(escape(utfstring))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM