Last active
October 16, 2022 15:16
-
-
Save seanghay/26e7d8293d3285f2984dd411b87d471a to your computer and use it in GitHub Desktop.
Convert Khmer Numerals to ASCII
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const km2ascii = (s) =>[...s].reduce((p,c)=>p+(c=c.charCodeAt(0),String.fromCharCode(c-(c>=6112&&c<=6121?6064:0))),'') | |
km2ascii('1234abc១២៣៤') | |
// => '1234abc1234' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment