[GH-ISSUE #267] [BUG] Text encoding problem in Simplified Chinese interface #186

Closed
opened 2026-02-25 20:35:07 +03:00 by kerem · 4 comments
Owner

Originally created by @ghost on GitHub (Apr 6, 2021).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/267

Describe the bug

Japanese word showed in search result was wrongly encoded.

To Reproduce
Steps to reproduce the behavior:

  1. Set Interface Language to Simplified Chinese
  2. Search any Japanese keyword, such as あなたの名前
  3. You'll find text like
キャスト: 監督・脚本:ロヘナ・ゲラ; 出演:ティロタマ・ショ�恁� ヴィヴェ�恁�・ゴ�恁螗啸� ギ�恁骏螗弗悭辍ぅ�ルカルニ��

Deployment Method

  • Heroku (one-click deploy)
  • Docker
  • run executable
  • pip/pipx
  • Other: [describe setup]

Version of Whoogle Search

  • Latest build from [source] (i.e. GitHub, Docker Hub, pip, etc)
  • Version v0.4.0
  • Not sure

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chromium
  • Version: 88.0.4324.182

Smartphone (please complete the following information):

  • Device:
  • OS: Android 11
  • Browser: Bromite
  • Version: 89.0.4389.117

Additional context

Originally created by @ghost on GitHub (Apr 6, 2021). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/267 **Describe the bug** Japanese word showed in search result was wrongly encoded. **To Reproduce** Steps to reproduce the behavior: 1. Set `Interface Language` to `Simplified Chinese` 2. Search any Japanese keyword, such as `あなたの名前` 3. You'll find text like ``` キャスト: 監督・脚本:ロヘナ・ゲラ; 出演:ティロタマ・ショ�恁� ヴィヴェ�恁�・ゴ�恁螗啸� ギ�恁骏螗弗悭辍ぅ�ルカルニ�� ``` **Deployment Method** - [ ] Heroku (one-click deploy) - [ ] Docker - [ ] `run` executable - [x] pip/pipx - [ ] Other: [describe setup] **Version of Whoogle Search** - [ ] Latest build from [source] (i.e. GitHub, Docker Hub, pip, etc) - [x] Version v0.4.0 - [ ] Not sure **Desktop (please complete the following information):** - OS: Windows 10 - Browser: Chromium - Version: 88.0.4324.182 **Smartphone (please complete the following information):** - Device: - OS: Android 11 - Browser: Bromite - Version: 89.0.4389.117 **Additional context**
kerem 2026-02-25 20:35:07 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ghost commented on GitHub (Apr 6, 2021):

It seems any phrase containing the is messed

<!-- gh-comment-id:814037266 --> @ghost commented on GitHub (Apr 6, 2021): It seems any phrase containing the `ー` is messed
Author
Owner

@jacr13 commented on GitHub (Apr 7, 2021):

After investigating a bit, the problem is the random user-agent generated by whoogle, more precisely the "Mozilla" part.

Google seems to return the response with "charset=GB2312" when the Mozilla word is replaced by a random one and "charset=UTF-8" when Mozilla is provided.

To solve the problem a quick fix is to replace this line :
github.com/benbusby/whoogle-search@d450cb1d61/app/request.py (L52)
by:
mozilla = "Mozilla"

<!-- gh-comment-id:815134396 --> @jacr13 commented on GitHub (Apr 7, 2021): After investigating a bit, the problem is the random user-agent generated by whoogle, more precisely the "Mozilla" part. Google seems to return the response with "charset=GB2312" when the Mozilla word is replaced by a random one and "charset=UTF-8" when Mozilla is provided. To solve the problem a quick fix is to replace this line : https://github.com/benbusby/whoogle-search/blob/d450cb1d616b6476afc4996c3aa9dfd8e1d15617/app/request.py#L52 by: `mozilla = "Mozilla"`
Author
Owner

@benbusby commented on GitHub (Apr 8, 2021):

Weird. Thanks @jacr13 for looking into that, I'll push a hotfix soon.

<!-- gh-comment-id:815825764 --> @benbusby commented on GitHub (Apr 8, 2021): Weird. Thanks @jacr13 for looking into that, I'll push a hotfix soon.
Author
Owner

@ghost commented on GitHub (Apr 8, 2021):

Screenshot was deleted for it's exposing my private instance url

<!-- gh-comment-id:815872891 --> @ghost commented on GitHub (Apr 8, 2021): Screenshot was deleted for it's exposing my private instance url
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whoogle-search#186
No description provided.