#1281: Convert to unicode early under Python 3.x. Thanks @delallea for the suggestion.