fix db encoding