added unicode support

Added support for parsing and writing unicode to the output