[xattr] Always use UTF-8
authorPhilipp Hagemeister <phihag@phihag.de>
Tue, 7 Jan 2014 05:49:15 +0000 (06:49 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Tue, 7 Jan 2014 05:49:15 +0000 (06:49 +0100)
On Windows and other systems, other encodings would break when trying to encode non-ASCII characters.
Simply use UTF-8, like every sane system.

youtube_dl/postprocessor/xattrpp.py

index 1cb8ecf1c89ce8b42b5dab16551ac9418a747b82..4317ba8366622ce7133f1d5234d13b2eb160c998 100644 (file)
@@ -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