rembo10/headphones — pull request #930 by mjc (2012-11-16 03:14:58+00:00)
Title: Fix unicode path handling and improve exception logging

Prior to this patch, on Windows, files had their paths and filenames decoded,
which resulted in e.g. "C₁₂H₂₂O₁₁" becoming "C12H22O11" when opened by
MediaFile(). CP1252 is really a rather terrible codepage so I also added it to the
poorly configured list.

I also noticed that when the directory is unicode already but not appended,
it was getting re-encoded before walking, then later decoded for
unicode_song_path, so I made sure both are checking to see if the string is
already UTF-8.

Additionally, the log line when a file can't be opened or processed now
includes the text of the exception. This greatly enhanced debugging this
issue and also helped me find a bunch of corrupted songs, so it's worth
keeping.

Needs testing on other platforms.