Changed double encoding selection from a public static to a optional parameter