Fix database encoding and force unicode for comparisson. refs #5854 (Affinitic)