From 823e36ad01104ca604e4f7e503ce148decec2e60 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 26 Mar 2012 12:14:30 -0700 Subject: [PATCH] normalize new filenames to with NFD --- beets/library.py | 2 ++ docs/changelog.rst | 1 + test/rsrc/test.blb | Bin 7168 -> 7168 bytes 3 files changed, 3 insertions(+) diff --git a/beets/library.py b/beets/library.py index b33ca8919..8a392384c 100644 --- a/beets/library.py +++ b/beets/library.py @@ -18,6 +18,7 @@ import re import sys import logging import shlex +import unicodedata from unidecode import unidecode from beets.mediafile import MediaFile from beets import plugins @@ -877,6 +878,7 @@ class Library(BaseLibrary): subpath = subpath_tmpl.substitute(mapping, funcs) # Encode for the filesystem, dropping unencodable characters. + subpath = unicodedata.normalize('NFD', subpath) if isinstance(subpath, unicode) and not fragment: encoding = sys.getfilesystemencoding() or sys.getdefaultencoding() subpath = subpath.encode(encoding, 'replace') diff --git a/docs/changelog.rst b/docs/changelog.rst index c4284b211..8ea447053 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,6 +22,7 @@ Changelog file for easy importing to other systems. Thanks to Fabrice Laporte. * :doc:`/plugins/bpd`: Use Gstreamer's ``playbin2`` element instead of the deprecated ``playbin``. +* Filenames are normalized with Unicode Normal Form D (NFD). 1.0b13 (March 16, 2012) diff --git a/test/rsrc/test.blb b/test/rsrc/test.blb index b4e0ddf799a126b3dcc1c298d227d40e31ed3d61..f7883366bb679802d572cc71a2ee36cf0ebfdc7c 100644 GIT binary patch delta 96 zcmZp$Xt0?R+MONJgU#Mh(!Vba!?l= delta 74 zcmZp$Xt0te+