Enhance unicode support in save2file method