Rewrote codepage support to use the new codepage tables.