All legal costs attending the arrest, examination or conveyance of an offender, except when directed or approved in writing by the counsel of the state or county commissioners, shall be paid by the complainant.