Added codepage support.

Also changed some diagnostics messages.