fix db connection encoding