diff --git a/sonata/misc.py b/sonata/misc.py index c5e2dcf..42aaabd 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',) + loc, encoding = locale.getlocale() + if loc in turkish: + locale.setlocale(locale.LC_CTYPE, "C") except: print "Failed to set locale" sys.exit(1)