Witnesses summoned by the court or the public prosecutor's office are entitled to compensation for loss of earnings and reimbursement of expenses.