Improved logic for CharsetUtils.GetCodePage()