summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>2009-04-22 22:57:21 +0200
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-10-31 11:24:08 +0100
commit2f4d18a9f78f9d18635c6047e56b33c689b8d026 (patch)
tree35a27742b4ca50aca6120a0505122eaca5448c33
parentb0eddb2eb4b8cad325ba3224c8550a21f67e4315 (diff)
downloadyoutube-dl-2f4d18a9f78f9d18635c6047e56b33c689b8d026.tar.gz
youtube-dl-2f4d18a9f78f9d18635c6047e56b33c689b8d026.tar.xz
youtube-dl-2f4d18a9f78f9d18635c6047e56b33c689b8d026.zip
Use getpreferredencoding() instead of getdefaultlocale()
This fixes issue #7 and is recommended after a bug report I made to the
Python team:

http://bugs.python.org/issue5815
-rwxr-xr-xyoutube-dl2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube-dl b/youtube-dl
index 20e26f99c..bc7e3b5fe 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -1056,7 +1056,7 @@ if __name__ == '__main__':
 		youtube_search_ie = YoutubeSearchIE(youtube_ie)
 
 		# File downloader
-		charset = locale.getdefaultlocale()[1]
+		charset = locale.getpreferredencoding()
 		if charset is None:
 			charset = 'ascii'
 		fd = FileDownloader({