mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-11-30 16:52:57 +01:00
Merge remote-tracking branch 'Asido/master'
This commit is contained in:
commit
1a9c655e3b
@ -37,15 +37,13 @@ def preferredencoding():
|
|||||||
Returns the best encoding scheme for the system, based on
|
Returns the best encoding scheme for the system, based on
|
||||||
locale.getpreferredencoding() and some further tweaks.
|
locale.getpreferredencoding() and some further tweaks.
|
||||||
"""
|
"""
|
||||||
def yield_preferredencoding():
|
|
||||||
try:
|
try:
|
||||||
pref = locale.getpreferredencoding()
|
pref = locale.getpreferredencoding()
|
||||||
u'TEST'.encode(pref)
|
u'TEST'.encode(pref)
|
||||||
except:
|
except:
|
||||||
pref = 'UTF-8'
|
pref = 'UTF-8'
|
||||||
while True:
|
|
||||||
yield pref
|
return pref
|
||||||
return yield_preferredencoding().next()
|
|
||||||
|
|
||||||
|
|
||||||
def htmlentity_transform(matchobj):
|
def htmlentity_transform(matchobj):
|
||||||
|
Loading…
Reference in New Issue
Block a user