fix database encoding