refacto and never use escape method

This commit is contained in:
Julien Calixte
2023-07-02 12:29:54 +02:00
parent 300d62db59
commit 492eb5ed3b
4 changed files with 19 additions and 9 deletions

View File

@@ -0,0 +1,8 @@
export const decodeBase64ToUTF8 = (content: string): string => {
return decodeURIComponent(
atob(content)
.split('')
.map((char) => `%${('00' + char.charCodeAt(0).toString(16)).slice(-2)}`)
.join('')
)
}