/*
* iconv implementation using Win32 API to convert.
*
* This file is placed in the public domain.
*/
/* for WC_NO_BEST_FIT_CHARS */
#ifndef WINVER
# define WINVER 0x0500
#endif
#define STRICT
#include <windows.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
/* WORKAROUND: */
#ifndef UNDER_CE
#define GetProcAddressA GetProcAddress
#endif
#if 0
# define MAKE_EXE
# define MAKE_DLL
# define USE_LIBICONV_DLL
#endif
#if !defined(DEFAULT_LIBICONV_DLL)
# define DEFAULT_LIBICONV_DLL ""
#endif
#define MB_CHAR_MAX 16
#define UNICODE_MODE_BOM_DONE 1
#define UNICODE_MODE_SWAPPED 2
#define FLAG_USE_BOM 1
#define FLAG_TRANSLIT 2 /* //TRANSLIT */
#define FLAG_IGNORE 4 /* //IGNORE */
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef void* iconv_t;
iconv_t iconv_open(const char *tocode, const char *fromcode);
int iconv_close(iconv_t cd);
size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
/* libiconv interface for vim */
#if defined(MAKE_DLL)
int
iconvctl (iconv_t cd, int request, void* argument)
{
/* not supported */
return 0;
}
#endif
typedef struct compat_t compat_t;
typedef struct csconv_t csconv_t;
typedef struct rec_iconv_t rec_iconv_t;
typedef iconv_t (*f_iconv_open)(const char *tocode, const char *fromcode);
typedef int (*f_iconv_close)(iconv_t cd);
typedef size_t (*f_iconv)(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
typedef int* (*f_errno)(void);
typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
typedef int (*f_mblen)(csconv_t *cv, const uchar *buf, int bufsize);
typedef int (*f_flush)(csconv_t *cv, uchar *buf, int bufsize);
#define COMPAT_IN 1
#define COMPAT_OUT 2
/* unicode mapping for compatibility with other conversion table. */
struct compat_t {
uint in;
uint out;
uint flag;
};
struct csconv_t {
int codepage;
int flags;
f_mbtowc mbtowc;
f_wctomb wctomb;
f_mblen mblen;
f_flush flush;
DWORD mode;
compat_t *compat;
};
struct rec_iconv_t {
iconv_t cd;
f_iconv_close iconv_close;
f_iconv iconv;
f_errno _errno;
csconv_t from;
csconv_t to;
#if defined(USE_LIBICONV_DLL)
HMODULE hlibiconv;
#endif
};
static int win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode);
static int win_iconv_close(iconv_t cd);
static size_t win_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
static int load_mlang();
static int make_csconv(const char *name, csconv_t *cv);
static int name_to_codepage(const char *name);
static uint utf16_to_ucs4(const ushort *wbuf);
static void ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize);
static int mbtowc_flags(int codepage);
static int must_use_null_useddefaultchar(int codepage);
static char *strrstr(const char *str, const char *token);
static char *xstrndup(const char *s, size_t n);
static int seterror(int err);
#if defined(USE_LIBICONV_DLL)
static int libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode);
static PVOID MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size);
static HMODULE find_imported_module_by_funcname(HMODULE hModule, const char *funcname);
static HMODULE hwiniconv;
#endif
static int sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize);
static int dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize);
static int mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize);
static int utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize);
static int eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize);
static int kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
static int kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
static int mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
static int mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
static int utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
static int utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
static int utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
static int utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
static int iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
static int iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
static int iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize);
static struct {
int codepage;
const char *name;
} codepage_alias[] = {
{65001, "CP65001"},
{65001, "UTF8"},
{65001, "UTF-8"},
{1200, "CP1200"},
{1200, "UTF16LE"},
{1200, "UTF-16LE"},
{1200, "UCS2LE"},
{1200, "UCS-2LE"},
{1201, "CP1201"},
{1201, "UTF16BE"},
{1201, "UTF-16BE"},
{1201, "UCS2BE"},
{1201, "UCS-2BE"},
{1201, "unicodeFFFE"},
{12000, "CP12000"},
{12000, "UTF32LE"},
{12000, "UTF-32LE"},
{12000, "UCS4LE"},
{12000, "UCS-4LE"},
{12001, "CP12001"},
{12001, "UTF32BE"},
{12001, "UTF-32BE"},
{12001, "UCS4BE"},
{12001, "UCS-4BE"},
#ifndef GLIB_COMPILATION
/*
* Default is big endian.
* See rfc2781 4.3 Interpreting text labelled as UTF-16.
*/
{1201, "UTF16"},
{1201, "UTF-16"},
{1201, "UCS2"},
{1201, "UCS-2"},
{12001, "UTF32"},
{12001, "UTF-32"},
{12001, "UCS-4"},
{12001, "UCS4"},
#else
/* Default is little endian, because the platform is */
{1200, "UTF16"},
{1200, "UTF-16"},
{1200, "UCS2"},
{1200, "UCS-2"},
{12000, "UTF32"},
{12000, "UTF-32"},
{12000, "UCS4"},
{12000, "UCS-4"},
#endif
/* copy from libiconv `iconv -l` */
/* !IsValidCodePage(367) */
{20127, "ANSI_X3.4-1968"},
{20127, "ANSI_X3.4-1986"},
{20127, "ASCII"},
{20127, "CP367"},
{20127, "IBM367"},
{20127, "ISO-IR-6"},
{20127, "ISO646-US"},
{20127, "ISO_646.IRV:1991"},
{20127, "US"},
{20127, "US-ASCII"},
{20127, "CSASCII"},
/* !IsValidCodePage(819) */
{1252, "CP819"},
{1252, "IBM819"},
{28591, "ISO-8859-1"},
{28591, "ISO-IR-100"},
{28591, "ISO8859-1"},
{28591, "ISO_8859-1"},
{28591, "ISO_8859-1:1987"},
{28591, "L1"},
{28591, "LATIN1"},
{28591, "CSISOLATIN1"},
{1250, "CP1250"},
{1250, "MS-EE"},
{1250, "WINDOWS-1250"},
{1251, "CP1251"},
{1251, "MS-CYRL"},
{1251, "WINDOWS-1251"},
{1252, "CP1252"},
{1252, "MS-ANSI"},
{1252, "WINDOWS-1252"},
{1253, "CP1253"},
{1253, "MS-GREEK"},
{1253, "WINDOWS-1253"},
{1254, "CP1254"},
{1254, "MS-TURK"},
{1254, "WINDOWS-1254"},
{1255, "CP1255"},
{1255, "MS-HEBR"},
{1255, "WINDOWS-1255"},
{1256, "CP1256"},
{1256, "MS-ARAB"},
{1256, "WINDOWS-1256"},
{1257, "CP1257"},
{1257, "WINBALTRIM"},
{1257, "WINDOWS-1257"},
{1258, "CP1258"},
{1258, "WINDOWS-1258"},
{850, "850"},
{850, "CP850"},
{850, "IBM850"},
{850, "CSPC850MULTILINGUAL"},
/* !IsValidCodePage(862) */
{862, "862"},
{862, "CP862"},
{862, "IBM862"},
{862, "CSPC862LATINHEBREW"},
{866, "866"},
{866, "CP866"},
{866, "IBM866"},
{866, "CSIBM866"},
/* !IsValidCodePage(154) */
{154
没有合适的资源?快使用搜索试试~ 我知道了~
使用QZXing识别图片二维码
共360个文件
h:113个
obj:109个
cpp:103个
5星 · 超过95%的资源 需积分: 16 79 下载量 157 浏览量
2016-04-04
00:07:51
上传
评论
收藏 8.97MB ZIP 举报
温馨提示
http://brightguo.com/easy-useqzxing/ 试了下QZXing这个识别二维码库,下载地址:百度网盘 本站下载连接 在github上下载qzxing(https://github.com/zxing/zxing中的QZXing) 新建qt工程,在pro文件中加入include(./QZXing_sourceV2.4/QZXing.pri) 调用QZXing类进行识别
资源推荐
资源详情
资源评论
收起资源包目录
使用QZXing识别图片二维码 (360个子文件)
win_iconv.c 61KB
BigUnsigned.cc 22KB
BigInteger.cc 12KB
BigUnsignedInABase.cc 4KB
BigIntegerAlgorithms.cc 2KB
BigIntegerUtils.cc 2KB
ChangeLog 9KB
PDF417BitMatrixParser.cpp 52KB
QRVersion.cpp 29KB
PDF417Detector.cpp 26KB
LinesSampler.cpp 25KB
QRFinderPatternFinder.cpp 20KB
PDF417DecodedBitStreamParser.cpp 20KB
AztecDetector.cpp 19KB
moc_QZXing.cpp 17KB
QRDecodedBitStreamParser.cpp 16KB
DataMatrixDetector.cpp 16KB
AztecDecoder.cpp 14KB
Code128Reader.cpp 14KB
DataMatrixDecodedBitStreamParser.cpp 14KB
QRDetector.cpp 12KB
DataMatrixBitMatrixParser.cpp 12KB
CodaBarReader.cpp 11KB
ITFReader.cpp 11KB
Code39Reader.cpp 10KB
UPCEANReader.cpp 10KB
MultiFinderPatternFinder.cpp 10KB
WhiteRectangleDetector.cpp 9KB
ModulusPoly.cpp 9KB
Code93Reader.cpp 9KB
OneDReader.cpp 8KB
qzxing.cpp 8KB
HybridBinarizer.cpp 8KB
DataMatrixVersion.cpp 7KB
GenericGFPoly.cpp 7KB
ErrorCorrection.cpp 7KB
QRAlignmentPatternFinder.cpp 7KB
GlobalHistogramBinarizer.cpp 7KB
BitArray.cpp 6KB
MonochromeRectangleDetector.cpp 6KB
StringUtils.cpp 6KB
ReedSolomonDecoder.cpp 6KB
QRBitMatrixParser.cpp 6KB
moc_imagehandler.cpp 5KB
PDF417Reader.cpp 5KB
PerspectiveTransform.cpp 5KB
DecodeHints.cpp 5KB
GenericMultipleBarcodeReader.cpp 5KB
QRFormatInformation.cpp 5KB
PDF417Decoder.cpp 5KB
MultiFormatReader.cpp 4KB
UPCEReader.cpp 4KB
GridSampler.cpp 4KB
QRDataBlock.cpp 4KB
MultiFormatUPCEANReader.cpp 4KB
DataMatrixDataBlock.cpp 4KB
GenericGF.cpp 4KB
QRDataMask.cpp 4KB
QRMode.cpp 4KB
ResultPoint.cpp 4KB
CharacterSetECI.cpp 4KB
BitMatrix.cpp 4KB
QRDecoder.cpp 3KB
MultiFormatOneDReader.cpp 3KB
DataMatrixDecoder.cpp 3KB
CameraImageWrapper.cpp 3KB
ModulusGF.cpp 3KB
GreyscaleLuminanceSource.cpp 3KB
GreyscaleRotatedLuminanceSource.cpp 3KB
LuminanceSource.cpp 3KB
EAN13Reader.cpp 3KB
QRFinderPattern.cpp 3KB
moc_widget.cpp 3KB
InvertedLuminanceSource.cpp 2KB
ByQuadrantReader.cpp 2KB
UPCAReader.cpp 2KB
BitSource.cpp 2KB
QRCodeMultiReader.cpp 2KB
QRErrorCorrectionLevel.cpp 2KB
BinaryBitmap.cpp 2KB
AztecReader.cpp 2KB
EAN8Reader.cpp 2KB
QRAlignmentPattern.cpp 2KB
QRCodeReader.cpp 2KB
Result.cpp 2KB
AztecDetectorResult.cpp 2KB
DataMatrixReader.cpp 2KB
DecoderResult.cpp 2KB
Str.cpp 2KB
MultiDetector.cpp 2KB
imagehandler.cpp 1KB
QRFinderPatternInfo.cpp 1KB
Binarizer.cpp 1KB
DataMatrixCornerPoint.cpp 1KB
Exception.cpp 1KB
DetectorResult.cpp 1KB
FormatException.cpp 1KB
BarcodeFormat.cpp 1KB
ResultIO.cpp 1KB
ChecksumException.cpp 1KB
共 360 条
- 1
- 2
- 3
- 4
资源评论
- onlycmm2018-03-12值得学习!~~
延陵小明
- 粉丝: 650
- 资源: 33
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功