Created
January 16, 2017 00:58
-
-
Save joepie91/2d59914167260eb9f2a987cff5fce644 to your computer and use it in GitHub Desktop.
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
> Array.from("\xff\xaa\x01\x32\x65") | |
[ 'ÿ', 'ª', '\u0001', '2', 'e' ] | |
node ~/test-encoding.js | hexdump -C | |
00000000 c3 bf c2 aa 01 32 65 0a |.....2e.| | |
00000008 | |
node ~/test-encoding2.js | hexdump -C | |
00000000 c3 bf c2 aa 01 32 65 0a |.....2e.| | |
00000008 | |
> Array.from("\xff\xaa\x01\x32\x65").map((char) => char.charCodeAt(0)) | |
[ 255, 170, 1, 50, 101 ] | |
> Array.from("\xff\xaa\x01\x32\x65").map((char) => char.charCodeAt(0).toString(16)) | |
[ 'ff', 'aa', '1', '32', '65' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment