adding utf8 support, still have trouble with cursor though