Add test to guard against encoding mangling of filter

Bug: 58316
Change-Id: Idd75710c55562a59da26893e2554c046f7129c1e