diff --git a/docs/changelog.rst b/docs/changelog.rst index a4d5ee44..8cfb9cdf 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -93,6 +93,14 @@ v0.20.0 (UNRELEASED) - Add basic tests for the stream library provider. +v0.19.6 (UNRELEASED) +==================== + +**Audio** + +- Support UTF-8 in M3U playlists. (Fixes: :issue:`853`) + + v0.19.5 (2014-12-23) ==================== diff --git a/mopidy/audio/playlists.py b/mopidy/audio/playlists.py index 5688db4b..5a362191 100644 --- a/mopidy/audio/playlists.py +++ b/mopidy/audio/playlists.py @@ -58,11 +58,11 @@ def parse_m3u(data): # TODO: convert non URIs to file URIs. found_header = False for line in data.readlines(): - if found_header or line.startswith('#EXTM3U'): + if found_header or line.startswith(b'#EXTM3U'): found_header = True else: continue - if not line.startswith('#') and line.strip(): + if not line.startswith(b'#') and line.strip(): yield line.strip() diff --git a/tests/audio/test_playlists.py b/tests/audio/test_playlists.py index eb79cfeb..f01568f8 100644 --- a/tests/audio/test_playlists.py +++ b/tests/audio/test_playlists.py @@ -13,7 +13,7 @@ BAD = b'foobarbaz' M3U = b"""#EXTM3U #EXTINF:123, Sample artist - Sample title file:///tmp/foo -#EXTINF:321,Example Artist - Example title +#EXTINF:321,Example Artist - Example \xc5\xa7\xc5\x95 file:///tmp/bar #EXTINF:213,Some Artist - Other title file:///tmp/baz @@ -25,7 +25,7 @@ File1=file:///tmp/foo Title1=Sample Title Length1=123 File2=file:///tmp/bar -Title2=Example title +Title2=Example \xc5\xa7\xc5\x95 Length2=321 File3=file:///tmp/baz Title3=Other title @@ -40,7 +40,7 @@ ASX = b""" - Example title + Example \xc5\xa7\xc5\x95 @@ -65,7 +65,7 @@ XSPF = b""" file:///tmp/foo - Example title + Example \xc5\xa7\xc5\x95 file:///tmp/bar