mirror of
https://github.com/beetbox/beets.git
synced 2026-01-04 15:03:22 +01:00
normalize new filenames to with NFD
This commit is contained in:
parent
3c4d8500e5
commit
823e36ad01
3 changed files with 3 additions and 0 deletions
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue