added support for Unicode output file