check that target is set before checking encoding