Section 184 of Criminal Procedure Code CAP 75: Charge of rape
Where a person is charged with rape and the court is of the opinion that he is not guilty of that offence but that he is guilty of an offence under one of the sections of the Sexual Offences Act, he may be convicted of that offence although he was not charged with it.
Check the current authoritative text and amendment history before relying on this provision.