(1) When a protected prisoner of war or a protected internee is convicted of an offence, the court shall:
(a) in fixing a term of imprisonment in respect of the offence, deduct from the term which it would otherwise have fixed any period during which the convicted person has been in custody in connection with that offence before the trial; and
(b) in fixing any penalty other than imprisonment in respect of the offence, take that period of custody into account.
(2) Where the Attorney - General is satisfied that a protected prisoner of war accused of an offence has been in custody in connection with that offence, while awaiting trial, in a place other than a camp or place in which protected prisoners of war are detained, for an aggregate period of not less than 3 months, the Attorney - General may direct that the prisoner shall be transferred from that custody to the custody of an officer of the Defence Force and thereafter remain in military custody at a camp or place in which protected prisoners of war are detained, and be brought before the court at the time appointed for his or her trial.