fix unicode and save to file issues