rework database encoding settings and conversions