question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Network Plugin can't parse UTF8 characters and can't decode images properly

See original GitHub issue

🐛 Bug Report

Network Plugin can’t parse UTF8 characters and can’t decode images properly.

To Reproduce

1.Test Link:

https://ex.ke.com/sdk/recommend/html/100001314?hdicCityId=110000&paramMap[source]=&id=100001314&mediumId=100000037&elementId=&resblockId=1111027381003&templateConfig=[object Object]&fbExpoId=346620976471638017&fbQueryId=&required400=true&unique=1111027381003&parentSceneId=

2.Test Code(React Native):

fetchData = () => {
  fetch('https://ex.ke.com/sdk/recommend/html/100001314?hdicCityId=110000&paramMap[source]=&id=100001314&mediumId=100000037&elementId=&resblockId=1111027381003&templateConfig=%5Bobject%20Object%5D&fbExpoId=346620976471638017&fbQueryId=&required400=true&unique=1111027381003&parentSceneId=')
}

render() {
  return (
    <TouchableOpacity onPress={this.fetchData}>
      <View></View>
    </TouchableOpacity>
  )
}

3.Flipper Network Plugin parse result(Error)

not

4. Browser parse result(correctly)

yes

5.image displays

Version 0.51 decodes and displays images correctly, version 0.52 shows (empty).Sometimes images are decoded into String in the absence of content-type

0.51 ⬇️ 0 51 0_Image

0.52 ⬇️ 0 52 0_Image

0.52 image decode into string ⬇️ 0 52 0_ImageP

Environment

iPhone11 iOS 13.3 macOS Mojave 10.14.5 Flipper 0.52.1 react-native 0.62.2 npm 6.14.1 node 13.12.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yaoandy107commented, Sep 22, 2020

I have written a minimal backend with Python Flask to retrieve the same issue in my Android device.

Test API code: https://gist.github.com/yaoandy107/1dc0daf2071aed0448e39100145b1ec3

Flipper ver: 0.57.0 Android ver: 11 & 9 OkHttp: 4.9.0

截圖 2020-09-22 下午12 29 23

1reaction
mweststratecommented, Aug 28, 2020

Image display will be fixed in next weeks release, that is a separate issue.

Looked a bit further in the charset issue, it seems to occur on iOS only but is correct on Android (screenshot). So I suspect it is an issue on the client, not in Flipper desktop.

Screenshot 2020-08-28 at 16 07 24

Edit: difference is that Android sends the gzipped response, but iOS unpacked. Will investigate further

Read more comments on GitHub >

github_iconTop Results From Across the Web

UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c
I have a socket server that is supposed to receive UTF-8 valid characters from clients. The problem is ...
Read more >
utf8_decode - Manual - PHP
This function converts the string string from the UTF-8 encoding to ISO-8859-1 . Bytes in the string which are not valid UTF-8 ,...
Read more >
Solving Unicode Problems in Python 2.7 - Azavea
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position ... is that the UTF-8 encoding can represent every Unicode character, ...
Read more >
Unicode & Character Encodings in Python: A Painless Guide
In this tutorial, you'll get a Python-centric introduction to character encodings and unicode. Handling character encodings and numbering systems can at ...
Read more >
A Guide to UTF-8 Encoding in PHP and MySQL - Toptal
While this change will ensure that PHP always outputs UTF-8 as the character encoding (in browser response Content-type headers), you still need to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found