Explorar o código

[xattr] Always use UTF-8

On Windows and other systems, other encodings would break when trying to encode non-ASCII characters.
Simply use UTF-8, like every sane system.
Philipp Hagemeister %!s(int64=12) %!d(string=hai) anos
pai
achega
afc7bc33cb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      youtube_dl/postprocessor/xattrpp.py

+ 1 - 1
youtube_dl/postprocessor/xattrpp.py

@@ -99,7 +99,7 @@ class XAttrMetadataPP(PostProcessor):
                     if infoname == "upload_date":
                         value = hyphenate_date(value)
 
-                    byte_value = value.encode(preferredencoding())
+                    byte_value = value.encode('utf-8')
                     write_xattr(filename, xattrname, byte_value)
 
             return True, info