Last active
October 16, 2022 15:16
-
-
Save seanghay/26e7d8293d3285f2984dd411b87d471a to your computer and use it in GitHub Desktop.
Revisions
-
seanghay revised this gist
Oct 16, 2022 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,4 @@ const km2ascii = (s) =>[...s].reduce((p,c)=>p+(c=c.charCodeAt(0),String.fromCharCode(c-(c>=6112&&c<=6121?6064:0))),'') km2ascii('1234abc១២៣៤') // => '1234abc1234' -
seanghay created this gist
Oct 16, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ const khmer2ascii = (s) => [...s].reduce((p, c) => p + (c = c.charCodeAt(0), String.fromCharCode(c >= 6112 && c <= 6121 ? c - 6064 : c)), '')