Support Chinese characters

Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/377

Reviewed By: passy

Differential Revision: D14299674

Pulled By: danielbuechele

fbshipit-source-id: 6b10370a4a367ae6e58415b8eeb5aef0864354f4
This commit is contained in:
JianyingLi
2019-03-04 05:12:33 -08:00
committed by Facebook Github Bot
parent c098269533
commit f4b2ce9a2b
2 changed files with 2 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ function decodeBody(container: Request | Response): string {
if (!container.data) {
return '';
}
const b64Decoded = atob(container.data);
const b64Decoded = decodeURIComponent(escape(atob(container.data)));
return getHeaderValue(container.headers, 'Content-Encoding') === 'gzip'
? decompress(b64Decoded)

View File

@@ -490,7 +490,7 @@ class SizeColumn extends PureComponent<{
if (lengthString != null && lengthString != '') {
length = parseInt(lengthString, 10);
} else if (response.data) {
length = atob(response.data).length;
length = decodeURIComponent(escape(atob(response.data))).length;
}
return length;
}