Except in cases where a different punishment is prescribed, every offense declared by this code to be a misdemeanor is punishable by imprisonment in a county jail, not exceeding six months, or by a fine not exceeding one thousand dollars ($1,000), or both.