Add Input mode support for Unicode, GS1 and Kanji

This commit is contained in:
hooper114 2009-01-11 09:11:03 +00:00
parent e246efe727
commit bc88024f04
5 changed files with 196 additions and 114 deletions

View file

@ -26,17 +26,13 @@
#ifndef NO_QR
#include <qrencode.h>
static int kanji = 0;
QRcode *encode(int security, int size, const unsigned char *intext)
QRcode *encode(int security, int size, const unsigned char *intext, int kanji)
{
int version;
QRecLevel level;
QRencodeMode hint;
QRcode *code;
level=QR_ECLEVEL_L;
if(kanji) {
hint = QR_MODE_KANJI;
} else {
@ -70,8 +66,11 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[])
QRcode *code;
int errno = 0;
int i, j;
int kanji;
code = encode(symbol->option_1, symbol->option_2, source);
if(symbol->input_mode == KANJI_MODE) { kanji = 1; } else { kanji = 0; }
code = encode(symbol->option_1, symbol->option_2, source, kanji);
if(code == NULL) {
strcpy(symbol->errtxt, "libqrencode failed to encode the input data [581]");
return ERROR_ENCODING_PROBLEM;