refacto and never use escape method
This commit is contained in:
8
src/utils/decodeBase64ToUTF8.ts
Normal file
8
src/utils/decodeBase64ToUTF8.ts
Normal 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('')
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user