Created
June 2, 2009 23:44
-
-
Save hail2u/122683 to your computer and use it in GitHub Desktop.
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 characters
| function escapeUnicode (str) { | |
| return str.replace(/[^ -~]|\\/g, function (c) { | |
| return '\\u' + ("0000" + c.charCodeAt(0).toString(16)).slice(-4); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment