Skip to content

Instantly share code, notes, and snippets.

@pranavrajs
Created November 3, 2016 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pranavrajs/f4433a3bc4d8e39fb9a31020473344e2 to your computer and use it in GitHub Desktop.
Save pranavrajs/f4433a3bc4d8e39fb9a31020473344e2 to your computer and use it in GitHub Desktop.
function escapeCharAndroid(promise) {
return promise.then(response => response.text())
.then((text) => {
if (Platform.OS === 'android') {
text = text.replace(/\r?\n/g, '').replace(/[\u0080-\uFFFF]/g, '');
}
return text;
})
.then(response => JSON.parse(response));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment