Fix DB encoding