简体   繁体   中英

How to convert cyrillic characters to ASCII codes with javascript

我确实需要一种将CP1251表中的所有字符转换为从0到255的ASCII码的方法。到目前为止,我发现的唯一方法是charCodeAt()函数,该函数仅适用于128以下的代码。对于较高的代码,它发出Unicode编号对我不利。

The first 128 characters in CP1251 are the same as the characters in ASCII. After that, they represent non-ASCII, cyrillic characters, which can't be converted to ASCII.

Consider using Unicode, which was invented to solve this kind of problem.

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