HANXIN fix wrong func call gb2312_utf8tosb() -> gb18030_utf8tosb()

This commit is contained in:
gitlost 2020-03-30 11:59:16 +01:00
parent 9b771dba3a
commit 22354a81f1
11 changed files with 80 additions and 64 deletions

View file

@ -1,6 +1,6 @@
/*
libzint - the open source barcode library
Copyright (C) 2008-2019 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2008-2020 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -1501,7 +1501,7 @@ static const Summary16 gb2312_uni2indx_pageff[15] = {
INTERNAL int gb2312_wctomb_zint(unsigned int* r, unsigned int wc) {
const Summary16 *summary = NULL;
if (wc >= 0x0000 && wc < 0x0460) {
if (wc < 0x0460) {
if (wc == 0x00b7) { /* ZINT: Patched to duplicate map to 0xA1A4 */
*r = 0xA1A4;
return 2;
@ -1542,8 +1542,8 @@ INTERNAL int gb2312_wctomb_zint(unsigned int* r, unsigned int wc) {
/* Convert UTF-8 string to GB 2312 (EUC-CN) and place in array of ints */
INTERNAL int gb2312_utf8tomb(struct zint_symbol *symbol, const unsigned char source[], size_t* p_length, unsigned int* gbdata) {
int i, error_number;
unsigned int length;
int error_number;
unsigned int i, length;
#ifndef _MSC_VER
unsigned int utfdata[*p_length + 1];
#else
@ -1591,9 +1591,9 @@ INTERNAL int gb2312_utf8tosb(int eci, const unsigned char source[], size_t* p_le
/* Copy byte input stream to array of ints, putting double-bytes that match GRIDMATRIX Chinese mode in single entry */
INTERNAL void gb2312_cpy(const unsigned char source[], size_t* p_length, unsigned int* gbdata) {
int i, j;
unsigned int length;
unsigned int i, j, length;
unsigned char c1, c2;
for (i = 0, j = 0, length = *p_length; i < length; i++, j++) {
if (length - i >= 2) {
c1 = source[i];