If such person is detained under the provisions of section 466 and in the case of a person detained in a jail, the Inspector General of Prisons, or, in the case of a person detained in a lunatic asylum, the visitors of such asylum or any two of them shall certify that, in his or their opinion such person is capable of making his defence, he sh...