MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.18k stars 1.12k forks source link

[Bug]: Characters cannot be displayed correctly on some web pages #9701

Open lydhvmo opened 6 months ago

lydhvmo commented 6 months ago

Describe the bug

When I access some websites using an Android device, the entire web content is not displayed. For example: https://www.pref.osaka.lg.jp/ Screenshot_20240521_155248_MetaMask

Expected behavior

Characters on the web page are displayed correctly

Screenshots/Recordings

https://github.com/MetaMask/metamask-mobile/assets/147371557/e664886b-ef9b-4a9c-96f9-6e180c320e25

Steps to reproduce

  1. Open meta mask
  2. Go to https://www.pref.osaka.lg.jp/
  3. See error

Error messages or log output

No response

Version

7.17.1

Build type

None

Device

Sam Sung galaxy s10

Operating system

Android

Additional context

No response

Severity

No response

ZbrancaI commented 6 months ago

Hello @lydhvmo! Thank you for reporting this issue! 😄 I can see that you're using Vietnamese as the default language on the app. Does the issue persist if you set the language to English?

gauthierpetetin commented 6 months ago

I just tried out in Vietnamese and English on 7.23.0 but am not able to reproduce this issue.

lydhvmo commented 6 months ago

@ZbrancaI @gauthierpetetin I downloaded version 7.22.0 and changed the language to English. Then I did the test again. Screenshot_20240522_170335_Settings

Video1: I access the website https://www.pref.osaka.lg.jp/ using metamask Bug: Characters are not displayed correctly. Please watch the attached video

https://github.com/MetaMask/metamask-mobile/assets/147371557/608a7781-a1cd-4f15-88b7-a3fcd2201517

Video2: I tried accessing that website on Google Chrome and everything was displayed correctly

https://github.com/MetaMask/metamask-mobile/assets/147371557/860dc0f2-9e43-45a1-8343-ec696dba57d2

NicolasMassart commented 6 months ago

I'm able to reproduce this on Android emulator and physical device with Android 13 / Moto edge 30 fusion / english language setup / metamask 7.23.0 (1331).

It works fine on iOS.

Explanation: Android webview has issues handling the shift_jis charset. If the Japanese website was encoded using the standard utf-8 charset, it would be fine. You can try with other .jp sites using utf-8 and you will see the correct chars (ex. https://www.expo2025.or.jp/, it's a random one I tried that is utf-8)

shift_jis is legacy and the new (like since 20y) way is to use utf-8. I doubt that Google will ever update their webview to support shift_jis charset.

gauthierpetetin commented 6 months ago

Thanks a lot for the investigation @NicolasMassart !

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.