handling unicode in a consistent way in python3