decode-utf8.ts 284 B

12345
  1. // TODO: MIGRATION: Can we use TextDecoder now? https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder
  2. // See http://ecmanaut.blogspot.co.uk/2006/07/encoding-decoding-utf8-in-javascript.html
  3. export function decodeUtf8(text: string) {
  4. return decodeURIComponent(escape(text))
  5. }