It is the duty of the judges of the circuit or criminal courts, whenever prisoners are convicted of any offense for which they are confined in the workhouse, to sentence the prisoners to the workhouse of the county, portable, movable or stationary, as may be provided and established in the county.