encoding value before response.set_cookie()

only encoding name is not enough.
encoding value is also required.