Skip to content

Instantly share code, notes, and snippets.

@agusputra
Created October 14, 2017 10:06
Show Gist options
  • Save agusputra/1df2453d821451179ca4111cea75cdc5 to your computer and use it in GitHub Desktop.
Save agusputra/1df2453d821451179ca4111cea75cdc5 to your computer and use it in GitHub Desktop.
Get UTF-8 bit/byte representation of unicode character in JS
new TextEncoder('utf-8').encode('\u0001')
new TextEncoder('utf-8').encode('\uffff')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment