The sheriff of the county has, except in cases otherwise provided by law, the custody and charge of the jail of the county and of all prisoners committed to the jail and may appoint a jailer.