overleaf/services/web/frontend/js/utils/decode-utf8.ts

6 lines
284 B
TypeScript
Raw Normal View History

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