Added codepage support.

Also changed some diagnostics messages.
This is not supported here. remove this section.