Ultraviolet-Node-Archive icon indicating copy to clipboard operation
Ultraviolet-Node-Archive copied to clipboard

Incorrect windows-1251 handling

Open zuev-stepan opened this issue 3 years ago • 0 comments

Sites encoded with windows-1251 are not rendered correctly.

Expected Behavior

Site should look just like it does without proxy.

Current Behavior

Non-ascii characters are replaced with mess (пїЅпїЅпїЅ).

Possible Solution

Instead of taking response.text(), you should decode it considering charset from headers and also update headers accordingly.

Steps to Reproduce

open rutracker.org

Context (Environment)

Detailed Description

Possible Implementation

I made a simple fix which works for rutracker, but you probably have to implement a better solution to work everywhere (https://github.com/zuev-stepan/Ultraviolet-Static/commit/551b5381e3c6a514d857d297bc27a779e53c7b4c)

zuev-stepan avatar Jul 21 '22 09:07 zuev-stepan