save with correct encoding