Made string conversion unicode compatible, which should also port nicely to python3