Added codepage support.

Also changed some diagnostics messages.
remove this