uBlock icon indicating copy to clipboard operation
uBlock copied to clipboard

HTML filtering breaks webpages of Shift_JIS encoding

Open yasmise opened this issue 8 years ago • 3 comments

Describe the issue

An issue similar to #3391 and #3397 also happens when the webpage's encoding is Shift_JIS. I think you are aware of this regarding to your comment, so I'm glad if you could add support for Shift_JIS.

One or more specific URLs where the issue occurs

http://www.sony.jp/ http://www.itmedia.co.jp/

Screenshot in which the issue can be seen

Left side is good, right side is broken.

www.sony.jp sony

www.itmedia.co.jp itmedia

Steps for anyone to reproduce the issue

  1. Add these testing filters.
sony.jp##^script:has-text(sony-marketing)
itmedia.co.jp##^script:has-text(document.write)
  1. Visit http://www.sony.jp/ or http://www.itmedia.co.jp/. The page is broken.
  2. Even I change the encoding to Unicode, text is still broken.

Your settings

  • OS/version: Windows 10 Home 1709
  • Browser/version: Firefox 57.0.3
  • uBlock Origin version: 1.14.23b12
Your filter lists

Default + JPN

Your custom filters (if any)

itmedia.co.jp##^script:has-text(document.write) sony.jp##^script:has-text(sony-marketing)

yasmise avatar Jan 04 '18 12:01 yasmise

This is part 1 of the fix: if a text encoding is not supported, bail out of enforcing HTML filtering. I thought I had it fixed when I fixed #3397, but clearly this was not working as intended. I tested the repro cases here, and HTML filtering was correctly skipped, since the encoding for Shift_JIS is not available yet.

gorhill avatar Jan 04 '18 23:01 gorhill

ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT

gorhill avatar Jan 05 '18 00:01 gorhill

Describe the issue

I have faced same issue. Just adding information.

One or more specific URLs where the issue occurs

http://www.wowkorea.jp/starnews/400626.html

Screenshot in which the issue can be seen

default

Steps for anyone to reproduce the issue

  1. Create and use a new profile for Firefox.
  2. Install uBlock Origin 1.15.0
  3. The filter settings are only below: .jp##^div[id^="div-gpt-ad"]
  4. Go to http://www.wowkorea.jp/starnews/400626.html

Your settings

  • OS/version: Windows 10 Japanese 16299.214
  • Browser/version: Firefox 58.0.1 64 bit
  • uBlock Origin version: 1.15.0
Your filter lists

just below only, no other filters.

.jp##^div[id^="div-gpt-ad"]

2

3

eEIi0A5L avatar Feb 03 '18 07:02 eEIi0A5L