Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8dac47f

Browse files
committed
Minor patch (for recognition of x-mac-turkish codec)
1 parent e197720 commit 8dac47f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/request/basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def checkCharEncoding(encoding, warn=True):
137137
encoding = encoding.replace("5589", "8859") # iso-5589 -> iso-8859
138138
elif "2313" in encoding:
139139
encoding = encoding.replace("2313", "2312") # gb2313 -> gb2312
140-
elif "x-euc" in encoding:
141-
encoding = encoding.replace("x-euc", "euc") # x-euc-kr -> euc-kr
140+
elif encoding.startswith("x-"):
141+
encoding = encoding[len("x-"):] # x-euc-kr -> euc-kr / x-mac-turkish -> mac-turkish
142142
elif "windows-cp" in encoding:
143143
encoding = encoding.replace("windows-cp", "windows") # windows-cp-1254 -> windows-1254
144144

0 commit comments

Comments
 (0)