alastair/python-musicbrainz-ngs — pull request #50 by JonnyJD (2012-03-22 11:33:24+00:00)
Title: force unicode strings on field input

Adds _unicode(string)
that gets the preferred encoding and tries to decode the string.
It is safe to pass in numbers or unicode objects.
The result will still be unicode.

Decoding errors are ignored, the corresponding characters are skipped.

This is only used in _do_mb_search.
Hopefully Lucene will give some results when some chars are missing.

Since we have all strings in unicode now, we don't need the unicode
literals u'...' anymore in _do_mb_search. (tested)
This might help supporting Python3.

(fix for #49)