More encoding code, time to start making it compile rather than
just add error messages.