Fix db connection encoding