diff --git a/sonata/misc.py b/sonata/misc.py index c5e2dcf..f3e7b82 100644 --- a/sonata/misc.py +++ b/sonata/misc.py @@ -222,7 +222,12 @@ def setlocale(): locale.setlocale(locale.LC_ALL, "") # XXX this makes python-mpd correctly return lowercase # keys for, e.g., playlistinfo() with a turkish locale: - locale.setlocale(locale.LC_CTYPE, "C") + # (and breaks playlist search with russian), + # so, added check for turkish here. + turkish = ('tr_TR',) + locale, encoding = locale.getlocale() + if locale in turkish: + locale.setlocale(locale.LC_CTYPE, "C") except: print "Failed to set locale" sys.exit(1)