Added codepage support.

Also changed some diagnostics messages.
we probably also want to error if you supply codePage and charset.  Really only one should be allowed at a time.