mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-21 10:25:54 +08:00
更新硬件SDK
This commit is contained in:
106
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/gb2312_to_ucs2.c
vendored
Normal file
106
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/gb2312_to_ucs2.c
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
/**************************************************************************
|
||||
* Copyright (C), AirM2M Tech. Co., Ltd.
|
||||
*
|
||||
* Name: gb2312_to_ucs2.c
|
||||
* Author: liweiqiang
|
||||
* Version: V0.1
|
||||
* Date: 2013/11/26
|
||||
*
|
||||
* Description:
|
||||
* gb2312 ת<><D7AA> ucs2
|
||||
**************************************************************************/
|
||||
#include <stdint.h>
|
||||
#include "stdio.h"
|
||||
#include "errno.h"
|
||||
|
||||
#include "gb2312_to_ucs2_table.h"
|
||||
|
||||
uint16_t gb2312_to_ucs(uint16_t gb2312)
|
||||
{
|
||||
uint16_t ucs;
|
||||
uint8_t gb = gb2312;
|
||||
|
||||
if (gb < 0x80)
|
||||
{
|
||||
ucs = gb;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint16_t offset = ((gb2312 >> 8) - 0xA0) * 94 + ((gb2312 & 0x00ff) - 0xA1);
|
||||
ucs = gb2312_to_ucs2_table[offset];
|
||||
}
|
||||
|
||||
return ucs;
|
||||
}
|
||||
|
||||
size_t iconv_gb2312_to_ucs2_endian(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft, int endian)
|
||||
{
|
||||
uint16_t offset,gb2312;
|
||||
char *gbbuf = *_inbuf;
|
||||
uint16_t *ucs2buf = (uint16_t*)*_outbuf;
|
||||
uint16_t ucs2;
|
||||
size_t ucs2len = 0;
|
||||
size_t inlen = *inbytesleft;
|
||||
size_t outlen = *outbytesleft;
|
||||
size_t ret = 0;
|
||||
|
||||
while(inlen > 0)
|
||||
{
|
||||
if(ucs2len+2 > outlen)
|
||||
{
|
||||
errno = E2BIG;
|
||||
ret = -1;
|
||||
goto gb2312_to_ucs2_exit;
|
||||
}
|
||||
|
||||
gb2312 = *gbbuf++;
|
||||
|
||||
if(gb2312 < 0x80)
|
||||
{
|
||||
ucs2 = gb2312;
|
||||
inlen--;
|
||||
}
|
||||
else if(inlen >= 2)
|
||||
{
|
||||
gb2312 = (gb2312<<8) + ((*gbbuf++)&0x00ff);
|
||||
inlen -= 2;
|
||||
|
||||
offset = ((gb2312>>8) - 0xA0)*94/*(0xFE-0xA1+1)*/ + ((gb2312&0x00ff) - 0xA1);
|
||||
ucs2 = gb2312_to_ucs2_table[offset];
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if(endian == 1)
|
||||
ucs2 = (ucs2<<8)|(ucs2>>8);
|
||||
|
||||
*ucs2buf++ = ucs2;
|
||||
ucs2len += 2;
|
||||
}
|
||||
|
||||
if(inlen > 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
gb2312_to_ucs2_exit:
|
||||
*_inbuf = gbbuf;
|
||||
|
||||
*inbytesleft = inlen;
|
||||
*outbytesleft -= ucs2len;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t iconv_gb2312_to_ucs2(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft)
|
||||
{
|
||||
return iconv_gb2312_to_ucs2_endian(_inbuf, inbytesleft, _outbuf, outbytesleft, 0);
|
||||
}
|
||||
|
||||
size_t iconv_gb2312_to_ucs2be(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft)
|
||||
{
|
||||
return iconv_gb2312_to_ucs2_endian(_inbuf, inbytesleft, _outbuf, outbytesleft, 1);
|
||||
}
|
||||
8274
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/gb2312_to_ucs2_table.h
vendored
Normal file
8274
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/gb2312_to_ucs2_table.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
112
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/iconv.c
vendored
Normal file
112
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/iconv.c
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
/**************************************************************************
|
||||
* Copyright (C), AirM2M Tech. Co., Ltd.
|
||||
*
|
||||
* Name: iconv.c
|
||||
* Author: liweiqiang
|
||||
* Version: V0.1
|
||||
* Date: 2013/7/15
|
||||
*
|
||||
* Description:
|
||||
* <20>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>
|
||||
**************************************************************************/
|
||||
/*
|
||||
@module iconv
|
||||
@summary <20>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>
|
||||
@version V0.1
|
||||
@data 2021<32><31>12<31><32>13<31><33>
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "iconv.h"
|
||||
#include "prv_iconv.h"
|
||||
|
||||
typedef struct builtin_iconv_map_tag
|
||||
{
|
||||
const char *from;
|
||||
const char *to;
|
||||
const iconv_fct fct;
|
||||
}builtin_iconv_map;
|
||||
|
||||
static const builtin_iconv_map iconv_map[] =
|
||||
{
|
||||
{"ucs2", "gb2312", iconv_ucs2_to_gb2312},
|
||||
/*+\NEW\liweiqiang\2013.11.26\<5C><><EFBFBD><EFBFBD>gb2312<->ucs2(ucs2be)<29><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>*/
|
||||
{"ucs2be", "gb2312", iconv_ucs2be_to_gb2312},
|
||||
{"gb2312", "ucs2", iconv_gb2312_to_ucs2},
|
||||
{"gb2312", "ucs2be", iconv_gb2312_to_ucs2be},
|
||||
/*-\NEW\liweiqiang\2013.11.26\<5C><><EFBFBD><EFBFBD>gb2312<->ucs2(ucs2be)<29><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>*/
|
||||
/*+\NEW\liweiqiang\2013.7.19\<5C><><EFBFBD><EFBFBD>utf8<->ucs2,ucs2be<62><65><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>*/
|
||||
{"utf8", "ucs2", iconv_utf8_to_ucs2},
|
||||
{"utf8", "ucs2be", iconv_utf8_to_ucs2be},
|
||||
{"ucs2", "utf8", iconv_ucs2_to_utf8},
|
||||
{"ucs2be", "utf8", iconv_ucs2be_to_utf8},
|
||||
/*-\NEW\liweiqiang\2013.7.19\<5C><><EFBFBD><EFBFBD>utf8<->ucs2,ucs2be<62><65><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>*/
|
||||
};
|
||||
|
||||
/*
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@function iconv.open(tocode, fromcode)
|
||||
@string tocode$Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ$gb2312/ucs2/ucs2be/utf8
|
||||
@string fromcode$Դ<><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ$gb2312/ucs2/ucs2be/utf8
|
||||
@return table$cd$<24><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>$
|
||||
@usage
|
||||
--unicode<64><65><EFBFBD>˱<EFBFBD><CBB1><EFBFBD> ת<><D7AA>Ϊ utf8<66><38><EFBFBD><EFBFBD>
|
||||
local cd = iconv.open("utf8", "ucs2be")
|
||||
*/
|
||||
iconv_t iconv_open (const char * to_code, const char * from_code)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for(i = 0; i < sizeof(iconv_map)/sizeof(iconv_map[0]); i++)
|
||||
{
|
||||
if(strcmp(iconv_map[i].from, from_code) == 0 &&
|
||||
strcmp(iconv_map[i].to, to_code) == 0)
|
||||
{
|
||||
return (iconv_t)&iconv_map[i];
|
||||
}
|
||||
}
|
||||
|
||||
return (iconv_t)-1;
|
||||
}
|
||||
|
||||
/*
|
||||
<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>
|
||||
@function cd:iconv(inbuf)
|
||||
@string inbuf$<24><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>$<24><><EFBFBD><EFBFBD>:ucs2s
|
||||
@return number$result$<24><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>$0<>ɹ<EFBFBD>,-1ʧ<31><CAA7>
|
||||
@usage
|
||||
--unicode<64><65><EFBFBD>˱<EFBFBD><CBB1><EFBFBD> ת<><D7AA>Ϊ utf8<66><38><EFBFBD><EFBFBD>
|
||||
function ucs2beToUtf8(ucs2s)
|
||||
local cd = iconv.open("utf8", "ucs2be")
|
||||
return cd:iconv(ucs2s)
|
||||
end
|
||||
*/
|
||||
size_t iconv_convert (iconv_t __cd, char ** __inbuf, size_t * __inbytesleft, char ** __outbuf, size_t * __outbytesleft)
|
||||
{
|
||||
builtin_iconv_map *_map_cd = (builtin_iconv_map *)__cd;
|
||||
|
||||
if(__inbuf == NULL || *__inbuf == NULL)
|
||||
return (size_t)-1;
|
||||
|
||||
if(_map_cd < &iconv_map[0] &&
|
||||
_map_cd > &iconv_map[sizeof(iconv_map)/sizeof(iconv_map[0])])
|
||||
return (size_t)-1;
|
||||
|
||||
return _map_cd->fct(__inbuf, __inbytesleft, __outbuf, __outbytesleft);
|
||||
}
|
||||
|
||||
/*
|
||||
<EFBFBD>ر<EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>
|
||||
@function iconv.close(cd)
|
||||
@string cd$iconv.open<65><6E><EFBFBD>صľ<D8B5><C4BE><EFBFBD>$
|
||||
@return
|
||||
@usage
|
||||
--<2D>ر<EFBFBD><D8B1>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>
|
||||
local cd = iconv.open("utf8", "ucs2be")
|
||||
iconv.close(cd)
|
||||
*/
|
||||
int iconv_close (iconv_t cd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
36
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/iconv.h
vendored
Normal file
36
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/iconv.h
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/**************************************************************************
|
||||
* Copyright (C), AirM2M Tech. Co., Ltd.
|
||||
*
|
||||
* Name: iconv.h
|
||||
* Author: liweiqiang
|
||||
* Version: V0.1
|
||||
* Date: 2013/7/15
|
||||
*
|
||||
* Description:
|
||||
* <20>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __ICONV_H__
|
||||
#define __ICONV_H__
|
||||
|
||||
// #include "stddef.h"
|
||||
|
||||
/* Identifier for conversion method from one codeset to another. */
|
||||
typedef void *iconv_t;
|
||||
|
||||
/* Allocate descriptor for code conversion from codeset FROMCODE to
|
||||
codeset TOCODE. */
|
||||
extern iconv_t iconv_open (const char *to_code, const char *from_code);
|
||||
|
||||
/* Convert at most *INBYTESLEFT bytes from *INBUF according to the
|
||||
code conversion algorithm specified by CD and place up to
|
||||
*OUTBYTESLEFT bytes in buffer at *OUTBUF. */
|
||||
extern size_t iconv_convert (iconv_t __cd, char ** __inbuf,
|
||||
size_t * __inbytesleft,
|
||||
char ** __outbuf,
|
||||
size_t * __outbytesleft);
|
||||
|
||||
/* Free resources allocated for descriptor CD for code conversion. */
|
||||
extern int iconv_close (iconv_t cd);
|
||||
|
||||
#endif/*__ICONV_H__*/
|
||||
33
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/prv_iconv.h
vendored
Normal file
33
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/prv_iconv.h
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/**************************************************************************
|
||||
* Copyright (C), AirM2M Tech. Co., Ltd.
|
||||
*
|
||||
* Name: prv_iconv.h
|
||||
* Author: liweiqiang
|
||||
* Version: V0.1
|
||||
* Date: 2013/7/15
|
||||
*
|
||||
* Description:
|
||||
* 字符编码转换内部声明文件
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __PRV_ICONV_H__
|
||||
#define __PRV_ICONV_H__
|
||||
|
||||
typedef size_t (*iconv_fct) (char ** __inbuf,
|
||||
size_t * __inbytesleft,
|
||||
char ** __outbuf,
|
||||
size_t * __outbytesleft);
|
||||
|
||||
size_t iconv_ucs2_to_gb2312(char **, size_t *, char **, size_t *);
|
||||
size_t iconv_ucs2be_to_gb2312(char **, size_t *, char **, size_t *);
|
||||
size_t iconv_gb2312_to_ucs2(char **, size_t *, char **, size_t *);
|
||||
size_t iconv_gb2312_to_ucs2be(char **, size_t *, char **, size_t *);
|
||||
size_t iconv_utf8_to_ucs2(char **, size_t *, char **, size_t *);
|
||||
|
||||
size_t iconv_utf8_to_ucs2be(char **, size_t *, char **, size_t *);
|
||||
|
||||
size_t iconv_ucs2_to_utf8(char **, size_t *, char **, size_t *);
|
||||
|
||||
size_t iconv_ucs2be_to_utf8(char **, size_t *, char **, size_t *);
|
||||
|
||||
#endif/*__PRV_ICONV_H__*/
|
||||
196
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/ucs2_to_gb2312.c
vendored
Normal file
196
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/ucs2_to_gb2312.c
vendored
Normal file
@@ -0,0 +1,196 @@
|
||||
/**************************************************************************
|
||||
* Copyright (C), AirM2M Tech. Co., Ltd.
|
||||
*
|
||||
* Name: ucs2_to_gb2312.c
|
||||
* Author: liweiqiang
|
||||
* Version: V0.1
|
||||
* Date: 2013/7/15
|
||||
*
|
||||
* Description:
|
||||
* ucs2 ת<><D7AA> gb2312
|
||||
**************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "stdio.h"
|
||||
#include "errno.h"
|
||||
|
||||
#include "ucs2_to_gb2312_table.h"
|
||||
#include "ucs2_to_gb2312_offset.h"
|
||||
|
||||
const uint8_t number_of_bit_1[256] =
|
||||
{
|
||||
0x00, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x03,
|
||||
0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04,
|
||||
0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x04, 0x05, 0x05, 0x06, 0x05, 0x06, 0x06, 0x07,
|
||||
0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x04, 0x05, 0x05, 0x06, 0x05, 0x06, 0x06, 0x07,
|
||||
0x02, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x05,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x04, 0x05, 0x05, 0x06, 0x05, 0x06, 0x06, 0x07,
|
||||
0x03, 0x04, 0x04, 0x05, 0x04, 0x05, 0x05, 0x06,
|
||||
0x04, 0x05, 0x05, 0x06, 0x05, 0x06, 0x06, 0x07,
|
||||
0x04, 0x05, 0x05, 0x06, 0x05, 0x06, 0x06, 0x07,
|
||||
0x05, 0x06, 0x06, 0x07, 0x06, 0x07, 0x07, 0x08,
|
||||
};
|
||||
|
||||
/* 0x4E00 <= ucs2 < 0xA000 */
|
||||
static uint16_t get_ucs2_offset(uint16_t ucs2)
|
||||
{
|
||||
uint16_t offset, page, tmp;
|
||||
uint8_t *mirror_ptr, ch;
|
||||
|
||||
page = (ucs2>>8) - 0x4E;
|
||||
ucs2 &= 0xFF;
|
||||
|
||||
tmp = ucs2>>6; /* now 0 <= tmp < 4 */
|
||||
offset = ucs2_index_table_4E00_9FFF[page][tmp];
|
||||
mirror_ptr = (uint8_t*)&ucs2_mirror_4E00_9FFF[page][tmp<<3]; /* [0, 8, 16, 24] */
|
||||
|
||||
tmp = ucs2&0x3F; /* mod 64 */
|
||||
|
||||
while(tmp >= 8)
|
||||
{
|
||||
offset += number_of_bit_1[*mirror_ptr];
|
||||
mirror_ptr++;
|
||||
tmp -= 8;
|
||||
}
|
||||
|
||||
ch = *mirror_ptr;
|
||||
if(ch&(0x1<<tmp))
|
||||
{ /* Ok , this ucs2 can be covert to GB2312. */
|
||||
while(tmp)
|
||||
{
|
||||
if(ch&0x1)
|
||||
offset++;
|
||||
ch>>=1;
|
||||
tmp--;
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
||||
return (uint16_t)(-1);
|
||||
}
|
||||
|
||||
uint16_t unicode_to_gb2312(uint16_t ucs2, uint8_t marks)
|
||||
{
|
||||
uint16_t gb = 0xA1A1;
|
||||
if(0x80 > ucs2)
|
||||
{
|
||||
// can be convert to ASCII char
|
||||
gb = ucs2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if((0x4E00 <= ucs2) && (0xA000 > ucs2))
|
||||
{
|
||||
uint16_t offset = get_ucs2_offset(ucs2);
|
||||
if((uint16_t)(-1) != offset)
|
||||
{
|
||||
gb = ucs2_to_gb2312_table[offset];
|
||||
}
|
||||
}
|
||||
else if (marks == 0)
|
||||
{
|
||||
uint16_t u16count = sizeof(tab_UCS2_to_GBK)/4;
|
||||
for(uint16_t ui=0; ui < u16count; ui++)
|
||||
{
|
||||
if(ucs2 == tab_UCS2_to_GBK[ui][0])
|
||||
{
|
||||
gb = tab_UCS2_to_GBK[ui][1];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return gb;
|
||||
}
|
||||
|
||||
/*+\NEW\liweiqiang\2013.11.26\<5C><><EFBFBD><EFBFBD>gb2312<->ucs2(ucs2be)<29><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>*/
|
||||
static size_t iconv_ucs2_to_gb2312_endian(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft, int endian)
|
||||
{
|
||||
uint16_t gb2312 = 0xA1A1;
|
||||
uint16_t ucs2;
|
||||
size_t gb_length = 0;
|
||||
uint16_t *ucs2buf = (uint16_t*)*_inbuf;
|
||||
char *outbuf = (char *)*_outbuf;
|
||||
size_t inlen = *inbytesleft/2;
|
||||
size_t outlen = *outbytesleft;
|
||||
size_t ret = 0;
|
||||
|
||||
while(inlen > 0)
|
||||
{
|
||||
if(gb_length+2 > outlen)
|
||||
{
|
||||
errno = E2BIG;
|
||||
ret = -1;
|
||||
goto ucs2_to_gb2312_exit;
|
||||
}
|
||||
|
||||
ucs2 = *ucs2buf++;
|
||||
|
||||
if(endian == 1)
|
||||
ucs2 = (ucs2<<8)|(ucs2>>8);
|
||||
|
||||
gb2312 = unicode_to_gb2312(ucs2, 0);
|
||||
//End 7205
|
||||
|
||||
if(0x80 > gb2312)
|
||||
{
|
||||
// can be convert to ASCII char
|
||||
*outbuf++ = (uint8_t)gb2312;
|
||||
gb_length++;
|
||||
}
|
||||
else
|
||||
{
|
||||
*outbuf++ = (uint8_t)(gb2312>>8);
|
||||
*outbuf++ = (uint8_t)(gb2312);
|
||||
gb_length += 2;
|
||||
}
|
||||
|
||||
inlen--;
|
||||
}
|
||||
|
||||
if(inlen > 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
ucs2_to_gb2312_exit:
|
||||
*inbytesleft = inlen;
|
||||
*outbytesleft -= gb_length;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t iconv_ucs2_to_gb2312(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft)
|
||||
{
|
||||
return iconv_ucs2_to_gb2312_endian(_inbuf, inbytesleft, _outbuf, outbytesleft, 0);
|
||||
}
|
||||
|
||||
size_t iconv_ucs2be_to_gb2312(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft)
|
||||
{
|
||||
return iconv_ucs2_to_gb2312_endian(_inbuf, inbytesleft, _outbuf, outbytesleft, 1);
|
||||
}
|
||||
/*-\NEW\liweiqiang\2013.11.26\<5C><><EFBFBD><EFBFBD>gb2312<->ucs2(ucs2be)<29><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>*/
|
||||
|
||||
581
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/ucs2_to_gb2312_offset.h
vendored
Normal file
581
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/ucs2_to_gb2312_offset.h
vendored
Normal file
@@ -0,0 +1,581 @@
|
||||
const uint16_t number_of_ucs2_4E00_9FFF = 0x1a6b;
|
||||
const uint8_t ucs2_mirror_4E00_9FFF[ 0xA0 - 0x4E ][256 >> 3] =
|
||||
{
|
||||
{
|
||||
0x8b, 0x7f, 0x7b, 0x7f, 0xb4, 0x3d, 0x55, 0xef,
|
||||
0xa8, 0xfb, 0x5d, 0xf3, 0x43, 0x02, 0x0b, 0x40,
|
||||
0x40, 0xfb, 0x3e, 0x8d, 0xf7, 0x7b, 0x2c, 0x8c,
|
||||
0xff, 0x6e, 0xfa, 0xe3, 0x3a, 0x1d, 0xed, 0xa8,
|
||||
},
|
||||
{
|
||||
0x02, 0xe6, 0x83, 0xcf, 0xf5, 0x8c, 0x55, 0x35,
|
||||
0x48, 0xe0, 0xab, 0xff, 0xb9, 0x92, 0x59, 0xd8,
|
||||
0x18, 0xab, 0x92, 0x28, 0xe9, 0xd7, 0x20, 0x80,
|
||||
0x38, 0xc4, 0x83, 0xf5, 0x4a, 0xe7, 0x0a, 0x45,
|
||||
},
|
||||
{
|
||||
0x00, 0xb0, 0x14, 0x97, 0x62, 0x77, 0x00, 0x54,
|
||||
0x88, 0xd1, 0x20, 0x14, 0x20, 0x10, 0xc0, 0xc8,
|
||||
0x21, 0x21, 0x00, 0x00, 0xa8, 0x13, 0x04, 0x0c,
|
||||
0x00, 0x80, 0x40, 0x04, 0xc0, 0x70, 0x28, 0x08,
|
||||
},
|
||||
{
|
||||
0xc0, 0x08, 0x04, 0x00, 0x02, 0x00, 0x00, 0x80,
|
||||
0x7b, 0x2b, 0x72, 0x14, 0x24, 0x79, 0xfb, 0x3b,
|
||||
0x27, 0x33, 0xe4, 0x1a, 0x35, 0x98, 0xef, 0x38,
|
||||
0xd1, 0x9a, 0x02, 0x28, 0x13, 0xa8, 0x69, 0xbf,
|
||||
},
|
||||
{
|
||||
0xcf, 0x65, 0xc6, 0x2f, 0x11, 0x6b, 0xc9, 0xaf,
|
||||
0x0f, 0x34, 0x53, 0x50, 0xa2, 0x86, 0x04, 0xa0,
|
||||
0x06, 0x01, 0x09, 0xe8, 0x0f, 0x3f, 0x0e, 0xc0,
|
||||
0x88, 0x0a, 0x45, 0x81, 0x10, 0x00, 0x01, 0xc6,
|
||||
},
|
||||
{
|
||||
0x61, 0xa1, 0xe1, 0x26, 0x4b, 0x44, 0x00, 0xce,
|
||||
0xaa, 0xc7, 0xee, 0xd4, 0xdf, 0xca, 0xbb, 0x85,
|
||||
0x74, 0x3a, 0x20, 0xa5, 0x6c, 0x43, 0x40, 0x88,
|
||||
0x06, 0x3f, 0xd2, 0x8b, 0x79, 0xff, 0xef, 0x3b,
|
||||
},
|
||||
{
|
||||
0x5a, 0xf7, 0xef, 0xe8, 0xcb, 0xfb, 0x36, 0x5b,
|
||||
0x49, 0x0d, 0xfd, 0x1b, 0x54, 0x01, 0xee, 0x39,
|
||||
0x55, 0xd8, 0x75, 0x2e, 0xd8, 0xbf, 0x1a, 0xa9,
|
||||
0xd7, 0xf3, 0xbf, 0xf6, 0xe0, 0x67, 0x0c, 0xb4,
|
||||
},
|
||||
{
|
||||
0xc2, 0x82, 0x13, 0x08, 0x9d, 0xd4, 0x8b, 0xd0,
|
||||
0x5a, 0x06, 0x61, 0x10, 0xf2, 0x74, 0xe0, 0x59,
|
||||
0x9f, 0x8f, 0x12, 0xb3, 0x80, 0x00, 0xaa, 0x6a,
|
||||
0x30, 0x32, 0x5e, 0xb0, 0x7a, 0x9d, 0xac, 0x60,
|
||||
},
|
||||
{
|
||||
0x03, 0xd3, 0x00, 0xc9, 0x98, 0x30, 0x56, 0x8a,
|
||||
0x00, 0x70, 0x90, 0x13, 0x14, 0x1f, 0x42, 0x18,
|
||||
0x60, 0xc0, 0x08, 0x00, 0x08, 0x80, 0x80, 0x10,
|
||||
0x00, 0x04, 0x90, 0xec, 0x17, 0x28, 0x33, 0xe6,
|
||||
},
|
||||
{
|
||||
0x58, 0x07, 0x00, 0x90, 0x08, 0xf7, 0x09, 0x4e,
|
||||
0x85, 0xf4, 0x83, 0xfc, 0x53, 0xaf, 0xc8, 0x18,
|
||||
0x7c, 0x18, 0x0c, 0x08, 0xdf, 0x6a, 0x14, 0x01,
|
||||
0x0c, 0xc8, 0x34, 0xa7, 0x11, 0xa0, 0x10, 0x27,
|
||||
},
|
||||
{
|
||||
0xc5, 0x28, 0x22, 0x42, 0x13, 0x04, 0x21, 0x00,
|
||||
0x10, 0x30, 0x12, 0x41, 0x20, 0x18, 0x00, 0x40,
|
||||
0x2b, 0x02, 0x0c, 0xc6, 0x00, 0x03, 0x00, 0x10,
|
||||
0x22, 0x00, 0x22, 0x00, 0x10, 0x58, 0x49, 0x02,
|
||||
},
|
||||
{
|
||||
0x94, 0xa0, 0x70, 0x96, 0xb0, 0xee, 0x92, 0x17,
|
||||
0x96, 0xcb, 0xf2, 0x05, 0x25, 0x00, 0x58, 0x23,
|
||||
0xde, 0x25, 0xcc, 0x42, 0x38, 0xcf, 0x04, 0x4a,
|
||||
0x40, 0x0c, 0x9f, 0x35, 0x28, 0x11, 0x00, 0x8a,
|
||||
},
|
||||
{
|
||||
0xfa, 0x13, 0x0a, 0x91, 0x29, 0x02, 0x56, 0x10,
|
||||
0x41, 0x06, 0x20, 0x04, 0x84, 0x04, 0xf0, 0x84,
|
||||
0x00, 0x00, 0x04, 0x0c, 0x00, 0x04, 0x2c, 0x41,
|
||||
0x06, 0x12, 0x54, 0x11, 0x4b, 0x0a, 0x02, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x02, 0xc0, 0x00, 0x00, 0x00, 0x94, 0x00,
|
||||
0x01, 0x00, 0xbb, 0xbf, 0x7c, 0x16, 0x2b, 0x24,
|
||||
0xbb, 0x9b, 0xa8, 0x7f, 0x7f, 0x0c, 0x79, 0xe3,
|
||||
0xf4, 0x10, 0x0d, 0xe0, 0x32, 0x41, 0x01, 0x9f,
|
||||
},
|
||||
{
|
||||
0x52, 0x86, 0x72, 0x35, 0xb4, 0x10, 0x12, 0xff,
|
||||
0x27, 0xcf, 0x23, 0x42, 0x6b, 0xc0, 0x02, 0x86,
|
||||
0x06, 0x31, 0xd3, 0x1f, 0x0c, 0x3a, 0xaa, 0xa1,
|
||||
0x12, 0x08, 0x04, 0x02, 0x72, 0x25, 0x01, 0x08,
|
||||
},
|
||||
{
|
||||
0xcc, 0x40, 0x50, 0x48, 0xd0, 0x62, 0x10, 0x60,
|
||||
0x80, 0x1c, 0x00, 0x29, 0x00, 0x9a, 0x10, 0x00,
|
||||
0x04, 0x00, 0x00, 0x22, 0x00, 0x00, 0x80, 0x00,
|
||||
0x20, 0x20, 0x00, 0x68, 0xe6, 0xcb, 0x9e, 0x60,
|
||||
},
|
||||
{
|
||||
0x6e, 0x91, 0x73, 0x3f, 0xc0, 0x60, 0x82, 0x39,
|
||||
0x34, 0x10, 0x30, 0x48, 0x06, 0x00, 0x5c, 0xbd,
|
||||
0xd1, 0x8c, 0xfb, 0xd6, 0xe1, 0x20, 0xe8, 0x43,
|
||||
0x00, 0x06, 0x4e, 0x08, 0x00, 0x05, 0xd0, 0xc4,
|
||||
},
|
||||
{
|
||||
0x1f, 0x8d, 0xaa, 0x89, 0xe1, 0xa6, 0x02, 0x16,
|
||||
0x01, 0x00, 0xed, 0x21, 0x56, 0x36, 0x8b, 0x1a,
|
||||
0xb7, 0x1f, 0xa5, 0x13, 0x02, 0x65, 0xa0, 0x30,
|
||||
0x78, 0xb2, 0xc7, 0x23, 0x93, 0x6c, 0x22, 0xe9,
|
||||
},
|
||||
{
|
||||
0x7f, 0xe4, 0x74, 0x3a, 0xe3, 0x8f, 0x20, 0x98,
|
||||
0x0e, 0x28, 0x25, 0x26, 0x9c, 0xbf, 0x49, 0xbf,
|
||||
0x18, 0x32, 0x54, 0xac, 0x49, 0xb9, 0x16, 0x19,
|
||||
0x60, 0x0c, 0x22, 0xb5, 0xc1, 0xfb, 0x59, 0x06,
|
||||
},
|
||||
{
|
||||
0x43, 0xe3, 0x20, 0x84, 0xd9, 0x08, 0x00, 0x80,
|
||||
0x00, 0x55, 0x22, 0x20, 0x84, 0x01, 0xa1, 0x00,
|
||||
0x00, 0x48, 0x10, 0x20, 0x80, 0x13, 0x80, 0x40,
|
||||
0x04, 0x0d, 0x16, 0x00, 0x40, 0x00, 0x20, 0x80,
|
||||
},
|
||||
{
|
||||
0x40, 0xfd, 0xe7, 0x8d, 0x36, 0x54, 0x98, 0xe0,
|
||||
0x8b, 0x7b, 0x1e, 0x09, 0xc8, 0xfe, 0x49, 0xd2,
|
||||
0x11, 0x06, 0xee, 0x8d, 0x37, 0x19, 0x22, 0xba,
|
||||
0xf4, 0x77, 0xdd, 0x9f, 0xec, 0xf3, 0xda, 0xf0,
|
||||
},
|
||||
{
|
||||
0x86, 0x43, 0x42, 0xec, 0x3f, 0x8d, 0x04, 0x26,
|
||||
0x6c, 0xfa, 0x21, 0xc0, 0x8e, 0x62, 0xc2, 0x0c,
|
||||
0x85, 0xd7, 0x45, 0x01, 0xad, 0x77, 0x99, 0x55,
|
||||
0x50, 0xe2, 0x45, 0x40, 0x0b, 0x26, 0x54, 0xa1,
|
||||
},
|
||||
{
|
||||
0x27, 0x98, 0x19, 0x58, 0x43, 0x34, 0x10, 0xa4,
|
||||
0xf2, 0x05, 0x14, 0x41, 0x80, 0x22, 0x00, 0x07,
|
||||
0xb4, 0x00, 0x66, 0x42, 0x10, 0x72, 0xa1, 0x15,
|
||||
0x25, 0x60, 0x85, 0x41, 0x54, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x01, 0x02, 0x04, 0x01, 0x20, 0xc8, 0x70, 0xcb,
|
||||
0x20, 0x93, 0x62, 0x6a, 0x4c, 0x18, 0x95, 0x00,
|
||||
0x80, 0x18, 0x8b, 0x9a, 0xb2, 0xaa, 0x01, 0x32,
|
||||
0x7a, 0xd8, 0xc4, 0x00, 0xe5, 0xf3, 0xc3, 0x04,
|
||||
},
|
||||
{
|
||||
0x4d, 0xd4, 0x38, 0xa2, 0xa1, 0xa1, 0x72, 0x50,
|
||||
0x0a, 0x98, 0xfc, 0x84, 0x52, 0xc1, 0xd1, 0x44,
|
||||
0x94, 0x10, 0xc2, 0x20, 0x80, 0x41, 0x10, 0x42,
|
||||
0x00, 0x00, 0x00, 0x3a, 0x40, 0x02, 0x9d, 0xd2,
|
||||
},
|
||||
{
|
||||
0x01, 0x2f, 0xb1, 0xa8, 0x40, 0xbd, 0x32, 0x24,
|
||||
0x4d, 0xd3, 0x4b, 0xd0, 0x23, 0xa7, 0xad, 0xd0,
|
||||
0x92, 0x0a, 0xa1, 0x75, 0xac, 0xad, 0xe9, 0x01,
|
||||
0x1a, 0x80, 0x1f, 0x77, 0x25, 0x92, 0x1b, 0xa0,
|
||||
},
|
||||
{
|
||||
0xa1, 0xdf, 0xca, 0x20, 0x02, 0x06, 0x8c, 0x73,
|
||||
0x7f, 0x57, 0x3b, 0x00, 0xff, 0x0b, 0xd0, 0x00,
|
||||
0x6a, 0x80, 0x88, 0x00, 0xc4, 0xa1, 0x29, 0x00,
|
||||
0x05, 0x2a, 0x24, 0x05, 0x09, 0x40, 0x23, 0x16,
|
||||
},
|
||||
{
|
||||
0x22, 0x68, 0x05, 0x80, 0x11, 0x20, 0x11, 0xa2,
|
||||
0x04, 0x00, 0x90, 0x64, 0x49, 0x48, 0x82, 0x13,
|
||||
0xd5, 0x23, 0x30, 0x19, 0x80, 0x29, 0x92, 0x08,
|
||||
0x02, 0x54, 0x11, 0x88, 0x01, 0x20, 0x04, 0xa0,
|
||||
},
|
||||
{
|
||||
0x00, 0x04, 0x80, 0x81, 0x02, 0x85, 0x22, 0x60,
|
||||
0x90, 0x00, 0x01, 0x0b, 0x22, 0x00, 0x02, 0x12,
|
||||
0x11, 0x40, 0x83, 0x00, 0x01, 0x1a, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x84, 0x46,
|
||||
0xc8, 0x12, 0x00, 0x02, 0xfc, 0x04, 0x00, 0x1a,
|
||||
0xde, 0x2e, 0x4c, 0x0c, 0x02, 0x04, 0xb8, 0x80,
|
||||
0x26, 0xa8, 0xfc, 0x0a, 0x02, 0x8c, 0x28, 0x22,
|
||||
},
|
||||
{
|
||||
0xe0, 0xa0, 0x7b, 0x8f, 0xd6, 0xc7, 0x35, 0x21,
|
||||
0xc7, 0x06, 0xb1, 0xf8, 0x13, 0x07, 0x55, 0x62,
|
||||
0x6e, 0x93, 0x19, 0x8a, 0xfa, 0x6e, 0x0e, 0xfb,
|
||||
0x30, 0x16, 0xf9, 0x48, 0x2f, 0xcd, 0xeb, 0x7d,
|
||||
},
|
||||
{
|
||||
0x92, 0x58, 0x84, 0x4e, 0xa0, 0x4c, 0x2e, 0x7a,
|
||||
0xea, 0xed, 0x1e, 0x56, 0x49, 0xc6, 0x90, 0x11,
|
||||
0x24, 0x53, 0x3a, 0xe8, 0xdb, 0xcf, 0x24, 0x81,
|
||||
0xf1, 0x18, 0x42, 0x63, 0x53, 0x58, 0x8a, 0x1a,
|
||||
},
|
||||
{
|
||||
0x20, 0x74, 0xd3, 0x24, 0x3b, 0xaa, 0x14, 0x05,
|
||||
0x18, 0x60, 0x58, 0x89, 0x00, 0x48, 0x00, 0xc0,
|
||||
0x68, 0x82, 0x01, 0x91, 0xa4, 0x84, 0xd6, 0x2c,
|
||||
0x86, 0x88, 0xba, 0xc4, 0x77, 0x03, 0x10, 0x02,
|
||||
},
|
||||
{
|
||||
0x44, 0x82, 0x38, 0x00, 0x11, 0xae, 0x4a, 0x40,
|
||||
0xc0, 0x28, 0x00, 0x51, 0x44, 0x60, 0x14, 0x15,
|
||||
0x10, 0x73, 0x00, 0x10, 0x82, 0x00, 0x48, 0x02,
|
||||
0x05, 0x02, 0x06, 0x40, 0x03, 0xc0, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x02, 0x0c, 0x08, 0x00, 0x20, 0x02,
|
||||
0x00, 0x90, 0x00, 0x40, 0x00, 0xb8, 0x61, 0xd1,
|
||||
0x21, 0x46, 0x74, 0x32, 0x00, 0xf8, 0x8a, 0x3b,
|
||||
0x0f, 0x05, 0x00, 0x8b, 0xd0, 0xbb, 0x80, 0x22,
|
||||
},
|
||||
{
|
||||
0x00, 0x06, 0x69, 0x07, 0x40, 0x80, 0x43, 0x00,
|
||||
0x20, 0x54, 0x00, 0x50, 0xd0, 0x41, 0x0c, 0x25,
|
||||
0x10, 0x84, 0x10, 0x83, 0x01, 0x11, 0x28, 0x02,
|
||||
0x08, 0x40, 0x30, 0x00, 0xa1, 0x40, 0x00, 0x02,
|
||||
},
|
||||
{
|
||||
0x40, 0x00, 0x00, 0x20, 0x00, 0x15, 0xe3, 0xab,
|
||||
0x80, 0x31, 0x44, 0xaa, 0xc6, 0xc2, 0x24, 0xc6,
|
||||
0x13, 0xac, 0x04, 0x80, 0x00, 0xb0, 0xd1, 0x03,
|
||||
0x1e, 0x61, 0x85, 0x42, 0x03, 0xf3, 0x9f, 0x1d,
|
||||
},
|
||||
{
|
||||
0x0a, 0x44, 0xe8, 0x78, 0x26, 0x5e, 0x92, 0xc3,
|
||||
0x00, 0x20, 0x85, 0x00, 0x01, 0xb0, 0x00, 0x40,
|
||||
0x90, 0x4a, 0x42, 0x88, 0x04, 0xca, 0x8d, 0x0c,
|
||||
0x05, 0xa7, 0x03, 0x42, 0xa1, 0x22, 0x04, 0x00,
|
||||
},
|
||||
{
|
||||
0x68, 0x86, 0x01, 0x0c, 0x64, 0x55, 0x79, 0x10,
|
||||
0x02, 0x00, 0xa0, 0xde, 0x00, 0x20, 0xc1, 0x40,
|
||||
0x8b, 0x48, 0x01, 0x50, 0x80, 0x03, 0x00, 0x04,
|
||||
0x00, 0x00, 0x04, 0x50, 0x5d, 0xc0, 0xd0, 0x80,
|
||||
},
|
||||
{
|
||||
0x10, 0xa0, 0x0a, 0x97, 0x20, 0xbb, 0xaf, 0x4d,
|
||||
0x21, 0xd9, 0x10, 0x1e, 0x60, 0x04, 0x14, 0x83,
|
||||
0x48, 0x88, 0xd6, 0xa6, 0x3b, 0xd8, 0x3f, 0x73,
|
||||
0xbc, 0x27, 0x74, 0x49, 0xdc, 0x0d, 0x13, 0x92,
|
||||
},
|
||||
{
|
||||
0x2b, 0x14, 0xa1, 0x8b, 0x75, 0x2e, 0x39, 0xd1,
|
||||
0x09, 0x30, 0x50, 0x50, 0x08, 0x88, 0x00, 0x69,
|
||||
0xd4, 0x49, 0x4a, 0x02, 0x10, 0x40, 0x16, 0x80,
|
||||
0x64, 0xe5, 0xd7, 0x89, 0x20, 0xc0, 0x16, 0x53,
|
||||
},
|
||||
{
|
||||
0x92, 0x2b, 0x00, 0x86, 0x45, 0xa3, 0xe0, 0x15,
|
||||
0x8b, 0x00, 0x03, 0x0c, 0x6e, 0x19, 0x00, 0xe2,
|
||||
0x31, 0x70, 0x06, 0x80, 0xa5, 0x16, 0x29, 0xa8,
|
||||
0x00, 0x20, 0x80, 0x18, 0xac, 0x7a, 0x48, 0xe1,
|
||||
},
|
||||
{
|
||||
0x07, 0x32, 0xd6, 0xb5, 0xe8, 0x32, 0x91, 0x5f,
|
||||
0xa1, 0x50, 0xe5, 0x20, 0x00, 0x7c, 0x80, 0x10,
|
||||
0x80, 0x72, 0x8a, 0x9d, 0xaa, 0x00, 0x1f, 0x42,
|
||||
0x22, 0x0e, 0x31, 0x02, 0x00, 0x11, 0x94, 0x04,
|
||||
},
|
||||
{
|
||||
0x22, 0x00, 0x08, 0x40, 0x10, 0x00, 0x10, 0x5c,
|
||||
0x43, 0x03, 0xc8, 0xfc, 0xa5, 0xa1, 0x80, 0x05,
|
||||
0x33, 0x84, 0x00, 0x04, 0x80, 0x00, 0x08, 0x6e,
|
||||
0x4b, 0x2a, 0x26, 0x81, 0xd8, 0xaa, 0x01, 0x29,
|
||||
},
|
||||
{
|
||||
0x4d, 0x68, 0x90, 0x44, 0x09, 0x00, 0x88, 0xba,
|
||||
0x40, 0x00, 0x82, 0x00, 0x00, 0x00, 0xd1, 0x87,
|
||||
0x5b, 0x21, 0xe6, 0xb1, 0x61, 0x31, 0x08, 0x80,
|
||||
0x00, 0x08, 0x40, 0xc2, 0x69, 0xa0, 0x00, 0xa6,
|
||||
},
|
||||
{
|
||||
0x58, 0x8d, 0x32, 0x4a, 0x71, 0x5d, 0x0a, 0x55,
|
||||
0xa0, 0x9a, 0x57, 0x2d, 0x05, 0x40, 0xa6, 0x4a,
|
||||
0x21, 0x20, 0xb1, 0x30, 0xc6, 0x3f, 0x12, 0x01,
|
||||
0xc2, 0x10, 0x0a, 0x26, 0x62, 0x44, 0x82, 0x50,
|
||||
},
|
||||
{
|
||||
0x80, 0x98, 0x40, 0x80, 0xc0, 0x04, 0x00, 0x81,
|
||||
0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38,
|
||||
0x00, 0x02, 0xa6, 0xf1, 0x34, 0x44, 0x0e, 0x72,
|
||||
0xa2, 0x35, 0xe0, 0x92, 0x01, 0x81, 0x00, 0x09,
|
||||
},
|
||||
{
|
||||
0x00, 0x04, 0x00, 0x00, 0x85, 0x88, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
|
||||
0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x88, 0xff, 0xbf, 0xef, 0xe7,
|
||||
0xff, 0xff, 0xbf, 0xff, 0xef, 0xef, 0xff, 0xfd,
|
||||
},
|
||||
{
|
||||
0xff, 0xfb, 0xfe, 0xbf, 0xff, 0xff, 0x7f, 0x05,
|
||||
0x34, 0x00, 0xb3, 0x85, 0x06, 0x47, 0x16, 0x42,
|
||||
0x02, 0x54, 0x10, 0xe4, 0x92, 0x80, 0x05, 0xb3,
|
||||
0x22, 0x54, 0x30, 0x81, 0x63, 0x42, 0x0b, 0x18,
|
||||
},
|
||||
{
|
||||
0x7b, 0x38, 0xf5, 0x13, 0xe5, 0x07, 0xea, 0xa9,
|
||||
0x4c, 0x3c, 0x14, 0x05, 0x00, 0x06, 0x02, 0x80,
|
||||
0xd9, 0x1a, 0x48, 0xbd, 0x37, 0xee, 0x96, 0xf4,
|
||||
0x5f, 0x70, 0xc0, 0x7e, 0xb2, 0xbf, 0x5f, 0x35,
|
||||
},
|
||||
{
|
||||
0x44, 0xe6, 0x5f, 0x45, 0x00, 0x90, 0x46, 0x41,
|
||||
0x40, 0x1d, 0x3b, 0x06, 0xa1, 0x62, 0x13, 0xfe,
|
||||
0x05, 0x85, 0x02, 0x39, 0x48, 0x05, 0x08, 0x0c,
|
||||
0x4f, 0x14, 0x00, 0x00, 0x88, 0x34, 0x18, 0x58,
|
||||
},
|
||||
{
|
||||
0x77, 0x30, 0x15, 0xd8, 0x0e, 0xbd, 0xfb, 0x4b,
|
||||
0x90, 0x8a, 0x00, 0x85, 0x00, 0xc1, 0x1d, 0xe6,
|
||||
0x14, 0xed, 0x86, 0xb3, 0x72, 0xff, 0x9b, 0x63,
|
||||
0x92, 0xfd, 0xbe, 0xd9, 0x7b, 0x88, 0x92, 0x0a,
|
||||
},
|
||||
{
|
||||
0xfe, 0xd3, 0xb2, 0x1c, 0x80, 0xb9, 0x7a, 0x17,
|
||||
0xc9, 0x82, 0x17, 0xdc, 0xfb, 0xff, 0x80, 0x39,
|
||||
0x60, 0x42, 0x0c, 0x59, 0x01, 0x0f, 0xdf, 0x37,
|
||||
0xa3, 0x94, 0x50, 0xb1, 0x23, 0x06, 0x07, 0x23,
|
||||
},
|
||||
{
|
||||
0x5a, 0xf8, 0x02, 0x31, 0xf0, 0x01, 0x02, 0x31,
|
||||
0x40, 0x00, 0x82, 0x1e, 0x0a, 0x3a, 0x6a, 0x05,
|
||||
0x84, 0x5b, 0x80, 0x12, 0x02, 0x80, 0x14, 0xa7,
|
||||
0x12, 0x26, 0x4b, 0xa0, 0x69, 0x10, 0x01, 0x90,
|
||||
},
|
||||
{
|
||||
0x00, 0x10, 0x8a, 0x84, 0x02, 0x18, 0x80, 0x3f,
|
||||
0x08, 0x07, 0x40, 0x42, 0x10, 0x01, 0x14, 0x4e,
|
||||
0xb0, 0x80, 0x00, 0x18, 0x10, 0xc5, 0x81, 0x02,
|
||||
0x02, 0x82, 0x29, 0x10, 0x10, 0x02, 0x00, 0x88,
|
||||
},
|
||||
{
|
||||
0x20, 0x00, 0x42, 0x00, 0x80, 0x02, 0x00, 0x11,
|
||||
0x00, 0xe0, 0x13, 0x44, 0x04, 0x58, 0x02, 0xfe,
|
||||
0x07, 0x3c, 0x28, 0x30, 0x98, 0x97, 0x73, 0x04,
|
||||
0xd1, 0xce, 0x13, 0xcb, 0x10, 0x62, 0x1f, 0x43,
|
||||
},
|
||||
{
|
||||
0x8d, 0x27, 0xac, 0x55, 0x2e, 0x42, 0x92, 0xc8,
|
||||
0x80, 0x53, 0x88, 0x02, 0x39, 0x40, 0x51, 0x78,
|
||||
0x2c, 0x29, 0x88, 0x80, 0x00, 0xb9, 0x28, 0x24,
|
||||
0x41, 0x0c, 0x0e, 0x08, 0x21, 0x44, 0x00, 0x42,
|
||||
},
|
||||
{
|
||||
0x08, 0x04, 0x68, 0x08, 0x06, 0x00, 0x04, 0x12,
|
||||
0x31, 0x30, 0x90, 0x02, 0x3e, 0x5b, 0x85, 0xe0,
|
||||
0x36, 0x29, 0x44, 0x10, 0x14, 0x28, 0x82, 0x10,
|
||||
0x66, 0x42, 0x34, 0x83, 0x3c, 0x01, 0x1b, 0x53,
|
||||
},
|
||||
{
|
||||
0x04, 0x04, 0x0d, 0x0e, 0x22, 0x0c, 0x51, 0x00,
|
||||
0x12, 0x00, 0x00, 0xc0, 0x40, 0x00, 0x00, 0x88,
|
||||
0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xf6, 0xdf, 0x47, 0x54, 0x68, 0x88, 0x08, 0x00,
|
||||
},
|
||||
{
|
||||
0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
|
||||
0x00, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x80, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xff, 0xef, 0xfd, 0xf7,
|
||||
0x7f, 0xff, 0xfe, 0xff, 0xff, 0xfb, 0xff, 0xff,
|
||||
},
|
||||
{
|
||||
0xff, 0xfd, 0xff, 0xbf, 0xff, 0xff, 0xff, 0x00,
|
||||
0xc2, 0x12, 0x20, 0x04, 0x06, 0x0c, 0x08, 0x07,
|
||||
0x24, 0x16, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0xe0, 0xfe, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0x79, 0x7f, 0xdf, 0x28, 0xf9, 0x00,
|
||||
0x32, 0x0c, 0x12, 0x80, 0x08, 0x00, 0x3a, 0xd5,
|
||||
0x58, 0xd8, 0xc2, 0xec, 0x18, 0x9d, 0xa8, 0x2f,
|
||||
},
|
||||
{
|
||||
0x20, 0x96, 0x10, 0xe0, 0x0c, 0xd6, 0x22, 0x26,
|
||||
0x97, 0x0f, 0x06, 0x02, 0x40, 0xb2, 0x55, 0x90,
|
||||
0xa2, 0x80, 0x11, 0x50, 0x00, 0x98, 0x04, 0x04,
|
||||
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0xfb, 0xff, 0xff,
|
||||
0xfe, 0xef, 0xfb, 0xdf, 0x08, 0x0b, 0x43, 0x62,
|
||||
0xb6, 0x41, 0x3b, 0xfb, 0x74, 0x6f, 0x89, 0x23,
|
||||
},
|
||||
{
|
||||
0x7f, 0xae, 0xd7, 0xec, 0x47, 0xe0, 0x60, 0x59,
|
||||
0x96, 0xa0, 0x8f, 0x09, 0x2c, 0x61, 0x30, 0xa0,
|
||||
0x0d, 0x09, 0xaa, 0x2a, 0x4e, 0xd4, 0x7b, 0x4f,
|
||||
0xb2, 0xc4, 0x8b, 0x38, 0xc6, 0xa9, 0x10, 0x61,
|
||||
},
|
||||
{
|
||||
0x14, 0x00, 0x00, 0x42, 0x0c, 0x80, 0x02, 0x02,
|
||||
0x48, 0xfe, 0x85, 0x64, 0x3e, 0xd6, 0xf7, 0xe3,
|
||||
0xa0, 0x3a, 0x07, 0x0c, 0x0c, 0xe4, 0x30, 0x04,
|
||||
0x80, 0xf6, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
||||
0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
|
||||
0xe0, 0xff, 0xbd, 0xfe, 0xff, 0xff, 0xff, 0xff,
|
||||
0x7f, 0x7f, 0xe7, 0xfb, 0xbf, 0xff, 0xff, 0xf7,
|
||||
},
|
||||
{
|
||||
0xff, 0xff, 0xff, 0xef, 0x7e, 0xff, 0xf7, 0xdf,
|
||||
0xf7, 0xf6, 0xdf, 0xfb, 0xfe, 0xbf, 0x4f, 0x80,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xff, 0x7f,
|
||||
},
|
||||
{
|
||||
0x7f, 0xff, 0xf7, 0xb6, 0x06, 0x44, 0x7e, 0xb8,
|
||||
0xf5, 0x3b, 0x31, 0x88, 0x96, 0x17, 0xf4, 0x00,
|
||||
0x60, 0xa9, 0x91, 0x13, 0x80, 0x00, 0x49, 0x72,
|
||||
0xf3, 0xf2, 0x24, 0x00, 0x01, 0x87, 0xc8, 0x42,
|
||||
},
|
||||
{
|
||||
0xd3, 0xe3, 0x48, 0x50, 0x00, 0x24, 0x05, 0x43,
|
||||
0x00, 0x00, 0x4c, 0x4a, 0x27, 0x02, 0x58, 0x10,
|
||||
0x20, 0x28, 0x16, 0x01, 0x09, 0xa8, 0x14, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0x3e, 0x68, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
|
||||
0xff, 0xb7, 0xdb, 0xfd, 0xf7, 0x00, 0x00, 0x00,
|
||||
0x00, 0x40, 0x2e, 0xc7, 0x80, 0x01, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x20, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0x00, 0xa8, 0xff, 0xf7, 0xb4,
|
||||
0xf3, 0xad, 0xff, 0x03, 0x20, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfb, 0xff,
|
||||
0xf7, 0x9d, 0xcf, 0xfd, 0xbf, 0x01, 0xc3, 0x15,
|
||||
0x27, 0x18, 0x0a, 0x81, 0x42, 0xa8, 0x00, 0x0a,
|
||||
},
|
||||
{
|
||||
0x08, 0x81, 0x08, 0x80, 0x08, 0x80, 0x04, 0x18,
|
||||
0xbe, 0xa3, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90,
|
||||
0xe6, 0x69, 0x37, 0xdc, 0xff, 0x6b, 0xff, 0x3d,
|
||||
0xf8, 0xfc, 0xf9, 0xf3, 0x04, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x80, 0x6f, 0xbf, 0xee, 0xe7,
|
||||
0xfe, 0xdf, 0xa2, 0x5d, 0xd8, 0x3f, 0x0b, 0xc0,
|
||||
0x84, 0x09, 0x0c, 0xa0, 0x40, 0x00, 0x10, 0x69,
|
||||
0x10, 0xe2, 0x12, 0xb9, 0xa5, 0x86, 0x00, 0x5a,
|
||||
},
|
||||
{
|
||||
0x00, 0x68, 0x89, 0x02, 0x05, 0x90, 0x80, 0x6a,
|
||||
0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80,
|
||||
0xf9, 0x1f, 0x00, 0x8e, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
};
|
||||
const uint16_t ucs2_index_table_4E00_9FFF[0xA0 - 0x4E][4] =
|
||||
{
|
||||
{0x0000, 0x002c, 0x0049, 0x006d, },
|
||||
{0x0096, 0x00b6, 0x00d8, 0x00f1, },
|
||||
{0x010e, 0x0124, 0x0134, 0x0141, },
|
||||
{0x014c, 0x0152, 0x0175, 0x0195, },
|
||||
{0x01b1, 0x01d5, 0x01eb, 0x0203, },
|
||||
{0x0212, 0x022a, 0x0251, 0x0268, },
|
||||
{0x0291, 0x02bc, 0x02db, 0x02fe, },
|
||||
{0x0325, 0x033e, 0x0358, 0x0373, },
|
||||
{0x0390, 0x03a7, 0x03ba, 0x03c3, },
|
||||
{0x03da, 0x03f0, 0x0410, 0x0428, },
|
||||
{0x043e, 0x044e, 0x0459, 0x0467, },
|
||||
{0x0473, 0x048f, 0x04a8, 0x04c4, },
|
||||
{0x04d8, 0x04ef, 0x04fe, 0x0507, },
|
||||
{0x0517, 0x051d, 0x0539, 0x0561, },
|
||||
{0x0579, 0x0596, 0x05b0, 0x05cc, },
|
||||
{0x05da, 0x05ec, 0x05f8, 0x05fc, },
|
||||
{0x0612, 0x062f, 0x0643, 0x0662, },
|
||||
{0x0671, 0x068d, 0x06a5, 0x06c0, },
|
||||
{0x06df, 0x0700, 0x0720, 0x073a, },
|
||||
{0x0755, 0x0767, 0x0774, 0x077e, },
|
||||
{0x0788, 0x07a7, 0x07c8, 0x07e5, },
|
||||
{0x0810, 0x082b, 0x0845, 0x0865, },
|
||||
{0x087b, 0x0892, 0x08a3, 0x08b8, },
|
||||
{0x08c5, 0x08d5, 0x08ea, 0x0901, },
|
||||
{0x091d, 0x0937, 0x0950, 0x095e, },
|
||||
{0x096d, 0x0986, 0x09a6, 0x09c2, },
|
||||
{0x09dd, 0x09f7, 0x0a16, 0x0a26, },
|
||||
{0x0a38, 0x0a48, 0x0a58, 0x0a6d, },
|
||||
{0x0a7a, 0x0a86, 0x0a91, 0x0a9b, },
|
||||
{0x0a9b, 0x0aa6, 0x0ab6, 0x0acc, },
|
||||
{0x0ae2, 0x0b02, 0x0b1f, 0x0b43, },
|
||||
{0x0b66, 0x0b80, 0x0b9e, 0x0bbc, },
|
||||
{0x0bd6, 0x0bef, 0x0bfd, 0x0c13, },
|
||||
{0x0c2a, 0x0c3c, 0x0c4c, 0x0c58, },
|
||||
{0x0c62, 0x0c68, 0x0c76, 0x0c8f, },
|
||||
{0x0ca5, 0x0cb3, 0x0cc3, 0x0cd0, },
|
||||
{0x0cd9, 0x0ce8, 0x0cff, 0x0d11, },
|
||||
{0x0d2f, 0x0d4a, 0x0d53, 0x0d67, },
|
||||
{0x0d78, 0x0d8e, 0x0d9c, 0x0da9, },
|
||||
{0x0db7, 0x0dd2, 0x0de6, 0x0e07, },
|
||||
{0x0e25, 0x0e43, 0x0e52, 0x0e63, },
|
||||
{0x0e7e, 0x0e95, 0x0ea9, 0x0ebf, },
|
||||
{0x0ed2, 0x0ef2, 0x0f04, 0x0f1c, },
|
||||
{0x0f2b, 0x0f35, 0x0f4d, 0x0f5b, },
|
||||
{0x0f73, 0x0f87, 0x0f92, 0x0faa, },
|
||||
{0x0fb9, 0x0fd5, 0x0fee, 0x1004, },
|
||||
{0x1016, 0x1021, 0x1029, 0x103f, },
|
||||
{0x1051, 0x1057, 0x1059, 0x105b, },
|
||||
{0x105b, 0x105c, 0x105e, 0x107d, },
|
||||
{0x10b9, 0x10ef, 0x1105, 0x1119, },
|
||||
{0x112d, 0x1150, 0x115f, 0x1183, },
|
||||
{0x11a9, 0x11c0, 0x11dc, 0x11ed, },
|
||||
{0x11fe, 0x1221, 0x1235, 0x125a, },
|
||||
{0x127c, 0x129e, 0x12c1, 0x12dc, },
|
||||
{0x12f4, 0x130a, 0x131d, 0x1330, },
|
||||
{0x1343, 0x1353, 0x1362, 0x1370, },
|
||||
{0x137b, 0x1382, 0x1396, 0x13af, },
|
||||
{0x13cc, 0x13e8, 0x13fc, 0x140e, },
|
||||
{0x141c, 0x1427, 0x143f, 0x1450, },
|
||||
{0x1469, 0x1478, 0x147f, 0x1482, },
|
||||
{0x149c, 0x149f, 0x14a1, 0x14a4, },
|
||||
{0x14a4, 0x14a6, 0x14a8, 0x14c5, },
|
||||
{0x1502, 0x1538, 0x1547, 0x154e, },
|
||||
{0x154e, 0x1570, 0x159b, 0x15ad, },
|
||||
{0x15cb, 0x15e0, 0x15f7, 0x1604, },
|
||||
{0x1605, 0x1605, 0x161e, 0x1644, },
|
||||
{0x1667, 0x168b, 0x16a2, 0x16c1, },
|
||||
{0x16db, 0x16e4, 0x1709, 0x171d, },
|
||||
{0x1726, 0x1726, 0x1727, 0x1729, },
|
||||
{0x172a, 0x172b, 0x172c, 0x172d, },
|
||||
{0x172f, 0x1730, 0x1731, 0x1769, },
|
||||
{0x17a2, 0x17dd, 0x180c, 0x180c, },
|
||||
{0x1822, 0x184b, 0x1868, 0x187c, },
|
||||
{0x1893, 0x18a8, 0x18b7, 0x18c5, },
|
||||
{0x18cf, 0x18cf, 0x18da, 0x18fc, },
|
||||
{0x1908, 0x190b, 0x1923, 0x193a, },
|
||||
{0x193a, 0x193a, 0x194d, 0x1975, },
|
||||
{0x1986, 0x1990, 0x199c, 0x199c, },
|
||||
{0x199c, 0x199c, 0x199e, 0x19cb, },
|
||||
{0x19e3, 0x19e3, 0x19e3, 0x19e3, },
|
||||
{0x19e3, 0x19fd, 0x1a22, 0x1a30, },
|
||||
{0x1a47, 0x1a57, 0x1a5b, 0x1a6b, },
|
||||
};
|
||||
6872
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/ucs2_to_gb2312_table.h
vendored
Normal file
6872
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/ucs2_to_gb2312_table.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
378
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/utf8_to_ucs2.c
vendored
Normal file
378
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/utf8_to_ucs2.c
vendored
Normal file
@@ -0,0 +1,378 @@
|
||||
/**************************************************************************
|
||||
* Copyright (C), AirM2M Tech. Co., Ltd.
|
||||
*
|
||||
* Name: utf8_to_ucs2.c
|
||||
* Author: liweiqiang
|
||||
* Version: V0.1
|
||||
* Date: 2013/7/19
|
||||
*
|
||||
* Description:
|
||||
* utf8 ת<><D7AA>Ϊ ucs2 le/be
|
||||
**************************************************************************/
|
||||
|
||||
#include "stdio.h"
|
||||
#include "errno.h"
|
||||
|
||||
#if 0
|
||||
/*****************************************************************************
|
||||
* <20><>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>Unicode(UCS-2<><32>UCS-4)<29><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>UTF-8<><38><EFBFBD><EFBFBD>.
|
||||
*
|
||||
* <20><><EFBFBD><EFBFBD>:
|
||||
* unic <20>ַ<EFBFBD><D6B7><EFBFBD>Unicode<64><65><EFBFBD><EFBFBD>ֵ
|
||||
* pOutput ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ洢UTF8<46><38><EFBFBD><EFBFBD>ֵ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
||||
* outsize pOutput<75><74><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С
|
||||
*
|
||||
* <20><><EFBFBD><EFBFBD>ֵ:
|
||||
* <20><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>UTF8<46><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 .
|
||||
*
|
||||
* ע<><D7A2>:
|
||||
* 1. UTF8û<38><C3BB><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>Unicode<64><65><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>Ҫ<EFBFBD><D2AA>;
|
||||
* <20>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>(Big Endian)<29><>С<EFBFBD><D0A1>(Little Endian)<29><><EFBFBD><EFBFBD>;
|
||||
* <20><>Intel<65><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD>С<EFBFBD>˷<EFBFBD><CBB7><EFBFBD>ʾ, <20>ڴ˲<DAB4><CBB2><EFBFBD>С<EFBFBD>˷<EFBFBD><CBB7><EFBFBD>ʾ. (<28>͵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>λ)
|
||||
* 2. <20>뱣֤ pOutput <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <20>ֽڵĿռ<C4BF><D5BC><EFBFBD>С!
|
||||
****************************************************************************/
|
||||
static int enc_unicode_to_utf8_one(unsigned long unic, unsigned char *pOutput,
|
||||
int outSize)
|
||||
{
|
||||
ASSERT(pOutput != NULL);
|
||||
ASSERT(outSize >= 6);
|
||||
|
||||
if ( unic <= 0x0000007F )
|
||||
{
|
||||
// * U-00000000 - U-0000007F: 0xxxxxxx
|
||||
*pOutput = (unic & 0x7F);
|
||||
return 1;
|
||||
}
|
||||
else if ( unic >= 0x00000080 && unic <= 0x000007FF )
|
||||
{
|
||||
// * U-00000080 - U-000007FF: 110xxxxx 10xxxxxx
|
||||
*(pOutput+1) = (unic & 0x3F) | 0x80;
|
||||
*pOutput = ((unic >> 6) & 0x1F) | 0xC0;
|
||||
return 2;
|
||||
}
|
||||
else if ( unic >= 0x00000800 && unic <= 0x0000FFFF )
|
||||
{
|
||||
// * U-00000800 - U-0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx
|
||||
*(pOutput+2) = (unic & 0x3F) | 0x80;
|
||||
*(pOutput+1) = ((unic >> 6) & 0x3F) | 0x80;
|
||||
*pOutput = ((unic >> 12) & 0x0F) | 0xE0;
|
||||
return 3;
|
||||
}
|
||||
else if ( unic >= 0x00010000 && unic <= 0x001FFFFF )
|
||||
{
|
||||
// * U-00010000 - U-001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
|
||||
*(pOutput+3) = (unic & 0x3F) | 0x80;
|
||||
*(pOutput+2) = ((unic >> 6) & 0x3F) | 0x80;
|
||||
*(pOutput+1) = ((unic >> 12) & 0x3F) | 0x80;
|
||||
*pOutput = ((unic >> 18) & 0x07) | 0xF0;
|
||||
return 4;
|
||||
}
|
||||
else if ( unic >= 0x00200000 && unic <= 0x03FFFFFF )
|
||||
{
|
||||
// * U-00200000 - U-03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
|
||||
*(pOutput+4) = (unic & 0x3F) | 0x80;
|
||||
*(pOutput+3) = ((unic >> 6) & 0x3F) | 0x80;
|
||||
*(pOutput+2) = ((unic >> 12) & 0x3F) | 0x80;
|
||||
*(pOutput+1) = ((unic >> 18) & 0x3F) | 0x80;
|
||||
*pOutput = ((unic >> 24) & 0x03) | 0xF8;
|
||||
return 5;
|
||||
}
|
||||
else if ( unic >= 0x04000000 && unic <= 0x7FFFFFFF )
|
||||
{
|
||||
// * U-04000000 - U-7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
|
||||
*(pOutput+5) = (unic & 0x3F) | 0x80;
|
||||
*(pOutput+4) = ((unic >> 6) & 0x3F) | 0x80;
|
||||
*(pOutput+3) = ((unic >> 12) & 0x3F) | 0x80;
|
||||
*(pOutput+2) = ((unic >> 18) & 0x3F) | 0x80;
|
||||
*(pOutput+1) = ((unic >> 24) & 0x3F) | 0x80;
|
||||
*pOutput = ((unic >> 30) & 0x01) | 0xFC;
|
||||
return 6;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int enc_get_utf8_size(char c)
|
||||
{
|
||||
int count = 0;
|
||||
while (c & (1<<7))
|
||||
{
|
||||
c = c << 1;
|
||||
count++;
|
||||
}
|
||||
return count == 0 ? 1 : count;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* <20><>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>UTF8<46><38><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>Unicode(UCS-2<><32>UCS-4)<29><><EFBFBD><EFBFBD>.
|
||||
*
|
||||
* <20><><EFBFBD><EFBFBD>:
|
||||
* pInput ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD>뻺<EFBFBD><EBBBBA><EFBFBD><EFBFBD>, <20><>UTF-8<><38><EFBFBD><EFBFBD>
|
||||
* pOutput ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>䱣<EFBFBD><E4B1A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD>Unicode<64><65><EFBFBD><EFBFBD>ֵ,
|
||||
* endian 1 - big endian
|
||||
* 0 - little endian
|
||||
*
|
||||
* <20><><EFBFBD><EFBFBD>ֵ:
|
||||
* <20>ɹ<EFBFBD><C9B9>ظ<F2B7B5BB><D8B8>ַ<EFBFBD><D6B7><EFBFBD>UTF8<46><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>õ<EFBFBD><C3B5>ֽ<EFBFBD><D6BD><EFBFBD>; ʧ<><CAA7><EFBFBD><EFBFBD>0.
|
||||
*
|
||||
* ע<><D7A2>:
|
||||
* 1. UTF8û<38><C3BB><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>Unicode<64><65><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>Ҫ<EFBFBD><D2AA>;
|
||||
* <20>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>(Big Endian)<29><>С<EFBFBD><D0A1>(Little Endian)<29><><EFBFBD><EFBFBD>;
|
||||
* <20><>Intel<65><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD>С<EFBFBD>˷<EFBFBD><CBB7><EFBFBD>ʾ, <20>ڴ˲<DAB4><CBB2><EFBFBD>С<EFBFBD>˷<EFBFBD><CBB7><EFBFBD>ʾ. (<28>͵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>λ)
|
||||
****************************************************************************/
|
||||
static int enc_utf8_to_unicode_one(const char* pInput, char* pOutput, int endian)
|
||||
{
|
||||
char b1, b2, b3/*, b4, b5, b6*/;
|
||||
int utfbytes = enc_get_utf8_size(*pInput);
|
||||
|
||||
switch ( utfbytes )
|
||||
{
|
||||
case 1:
|
||||
if(endian)
|
||||
{
|
||||
*pOutput++ = 0x00;
|
||||
*pOutput = *pInput;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pOutput++ = *pInput;
|
||||
*pOutput = 0x00;
|
||||
}
|
||||
return 2;
|
||||
//break;
|
||||
case 2:
|
||||
b1 = *pInput;
|
||||
b2 = *(pInput + 1);
|
||||
/*+\BUG\wangyuan\2020.11.18\<5C><><EFBFBD><EFBFBD>һЩ<D2BB><D0A9><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>᷵<EFBFBD>ش<EFBFBD><D8B4><EFBFBD>*/
|
||||
/*UTF-8<><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽΪ 1100xxxx 10xxxxxx
|
||||
<09><><EFBFBD><EFBFBD>:'<27><>'<27><> UTF-8<><38><EFBFBD><EFBFBD> 11000010 10110111*/
|
||||
if ( (b2 & 0xC0) != 0x80 )
|
||||
return -1;
|
||||
/*-\BUG\wangyuan\2020.11.18\<5C><><EFBFBD><EFBFBD>һЩ<D2BB><D0A9><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>᷵<EFBFBD>ش<EFBFBD><D8B4><EFBFBD>*/
|
||||
if(endian)
|
||||
{
|
||||
*pOutput++ = (b1 >> 2) & 0x07;
|
||||
*pOutput = (b1 << 6) + (b2 & 0x3F);
|
||||
}
|
||||
else
|
||||
{
|
||||
*pOutput++ = (b1 << 6) + (b2 & 0x3F);
|
||||
*pOutput = (b1 >> 2) & 0x07;
|
||||
}
|
||||
return 2;
|
||||
//break;
|
||||
case 3:
|
||||
b1 = *pInput;
|
||||
b2 = *(pInput + 1);
|
||||
b3 = *(pInput + 2);
|
||||
if ( ((b2 & 0xC0) != 0x80) || ((b3 & 0xC0) != 0x80) )
|
||||
return -1;
|
||||
if(endian)
|
||||
{
|
||||
*pOutput++ = (b1 << 4) + ((b2 >> 2) & 0x0F);
|
||||
*pOutput = (b2 << 6) + (b3 & 0x3F);
|
||||
}
|
||||
else
|
||||
{
|
||||
*pOutput++ = (b2 << 6) + (b3 & 0x3F);
|
||||
*pOutput = (b1 << 4) + ((b2 >> 2) & 0x0F);
|
||||
}
|
||||
return 2;
|
||||
//break;
|
||||
#if 0
|
||||
case 4:
|
||||
b1 = *pInput;
|
||||
b2 = *(pInput + 1);
|
||||
b3 = *(pInput + 2);
|
||||
b4 = *(pInput + 3);
|
||||
if ( ((b2 & 0xC0) != 0x80) || ((b3 & 0xC0) != 0x80)
|
||||
|| ((b4 & 0xC0) != 0x80) )
|
||||
return -1;
|
||||
*pOutput = (b3 << 6) + (b4 & 0x3F);
|
||||
*(pOutput+1) = (b2 << 4) + ((b3 >> 2) & 0x0F);
|
||||
*(pOutput+2) = ((b1 << 2) & 0x1C) + ((b2 >> 4) & 0x03);
|
||||
return 3;
|
||||
break;
|
||||
case 5:
|
||||
b1 = *pInput;
|
||||
b2 = *(pInput + 1);
|
||||
b3 = *(pInput + 2);
|
||||
b4 = *(pInput + 3);
|
||||
b5 = *(pInput + 4);
|
||||
if ( ((b2 & 0xC0) != 0x80) || ((b3 & 0xC0) != 0x80)
|
||||
|| ((b4 & 0xC0) != 0x80) || ((b5 & 0xC0) != 0x80) )
|
||||
return -1;
|
||||
*pOutput = (b4 << 6) + (b5 & 0x3F);
|
||||
*(pOutput+1) = (b3 << 4) + ((b4 >> 2) & 0x0F);
|
||||
*(pOutput+2) = (b2 << 2) + ((b3 >> 4) & 0x03);
|
||||
*(pOutput+3) = (b1 << 6);
|
||||
return 4;
|
||||
break;
|
||||
case 6:
|
||||
b1 = *pInput;
|
||||
b2 = *(pInput + 1);
|
||||
b3 = *(pInput + 2);
|
||||
b4 = *(pInput + 3);
|
||||
b5 = *(pInput + 4);
|
||||
b6 = *(pInput + 5);
|
||||
if ( ((b2 & 0xC0) != 0x80) || ((b3 & 0xC0) != 0x80)
|
||||
|| ((b4 & 0xC0) != 0x80) || ((b5 & 0xC0) != 0x80)
|
||||
|| ((b6 & 0xC0) != 0x80) )
|
||||
return -1;
|
||||
*pOutput = (b5 << 6) + (b6 & 0x3F);
|
||||
*(pOutput+1) = (b5 << 4) + ((b6 >> 2) & 0x0F);
|
||||
*(pOutput+2) = (b3 << 2) + ((b4 >> 4) & 0x03);
|
||||
*(pOutput+3) = ((b1 << 6) & 0x40) + (b2 & 0x3F);
|
||||
return 4;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static size_t enc_utf8_to_unicode(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft, int endian)
|
||||
{
|
||||
size_t maxOLen = *outbytesleft;
|
||||
size_t iLen = *inbytesleft;
|
||||
char *src = *_inbuf;
|
||||
char *dst = *_outbuf;
|
||||
size_t iPos, oPos;
|
||||
size_t utfbytes = 0;
|
||||
size_t unicodeBytes = 0;
|
||||
int result = 0;
|
||||
|
||||
for(iPos = 0, oPos = 0; iPos < iLen; )
|
||||
{
|
||||
if(oPos + 2 > maxOLen)
|
||||
{
|
||||
errno = E2BIG;
|
||||
result = -1;
|
||||
goto utf8_to_ucs2_exit;
|
||||
}
|
||||
|
||||
utfbytes = enc_get_utf8_size(src[iPos]);
|
||||
|
||||
if(utfbytes == 0)
|
||||
utfbytes = 1;
|
||||
|
||||
if((unicodeBytes = enc_utf8_to_unicode_one(&src[iPos], &dst[oPos], endian)) == -1)
|
||||
{
|
||||
errno = EINVAL;
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
oPos += unicodeBytes;
|
||||
iPos += utfbytes;
|
||||
}
|
||||
|
||||
utf8_to_ucs2_exit:
|
||||
*inbytesleft -= iPos;
|
||||
*_inbuf += iPos;
|
||||
*outbytesleft -= oPos;
|
||||
|
||||
return (size_t)result;
|
||||
}
|
||||
|
||||
size_t iconv_utf8_to_ucs2(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft)
|
||||
{
|
||||
return enc_utf8_to_unicode(_inbuf, inbytesleft, _outbuf, outbytesleft, 0);
|
||||
}
|
||||
|
||||
size_t iconv_utf8_to_ucs2be(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft)
|
||||
{
|
||||
return enc_utf8_to_unicode(_inbuf, inbytesleft, _outbuf, outbytesleft, 1);
|
||||
}
|
||||
|
||||
|
||||
static size_t enc_unicode_to_utf8(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft, int endian)
|
||||
{
|
||||
size_t maxOLen = *outbytesleft;
|
||||
size_t iLen = *inbytesleft;
|
||||
char *src = *_inbuf;
|
||||
char *dst = *_outbuf;
|
||||
size_t iPos, oPos;
|
||||
size_t utfbytes = 0;
|
||||
int result = 0;
|
||||
size_t unicodeVal = 0;
|
||||
|
||||
for(iPos = 0, oPos = 0; iPos+1 < iLen;)
|
||||
{
|
||||
unicodeVal = ((endian==1) ? ((unsigned char)src[iPos]*256+(unsigned char)src[iPos+1]) : ((unsigned char)src[iPos+1]*256+(unsigned char)src[iPos]));
|
||||
//printf("test1:%d,%X,%X,%X\n",endian,unicodeVal,src[iPos],src[iPos+1]);
|
||||
|
||||
if(unicodeVal <= 0x7F)
|
||||
{
|
||||
utfbytes = 1;
|
||||
}
|
||||
else if(unicodeVal > 0x7F && unicodeVal <= 0x07FF)
|
||||
{
|
||||
utfbytes = 2;
|
||||
}
|
||||
else if(unicodeVal > 0x07FF)
|
||||
{
|
||||
utfbytes = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
errno = EINVAL;
|
||||
result = -1;
|
||||
goto ucs2_to_utf8_exit;
|
||||
}
|
||||
|
||||
|
||||
if(oPos + utfbytes > maxOLen)
|
||||
{
|
||||
errno = E2BIG;
|
||||
result = -1;
|
||||
goto ucs2_to_utf8_exit;
|
||||
}
|
||||
|
||||
switch ( utfbytes )
|
||||
{
|
||||
case 1:
|
||||
dst[oPos] = unicodeVal;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
dst[oPos] = ((unicodeVal>>6)|0xE0)&0xDF;
|
||||
dst[oPos+1] = ((char)(unicodeVal&0xFF)|0xC0)&0xBF;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
dst[oPos] = (((unicodeVal>>12)&0xFF)|0xF0)&0xEF;
|
||||
dst[oPos+1] = (((unicodeVal>>6)&0xFF)|0xC0)&0xBF;
|
||||
//printf("test:%X,%X,%X,%X,%X,",unicodeVal,unicodeVal>>6,((unicodeVal>>6)&0xFF),((unicodeVal>>6)&0xFF)|0xC0,dst[oPos+1]);
|
||||
dst[oPos+2] =((unicodeVal&0xFF)|0xC0)&0xBF;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
iPos += 2;
|
||||
oPos += utfbytes;
|
||||
}
|
||||
|
||||
ucs2_to_utf8_exit:
|
||||
*inbytesleft -= iPos;
|
||||
*_inbuf += iPos;
|
||||
*outbytesleft -= oPos;
|
||||
|
||||
return (size_t)result;
|
||||
}
|
||||
|
||||
size_t iconv_ucs2_to_utf8(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft)
|
||||
{
|
||||
return enc_unicode_to_utf8(_inbuf, inbytesleft, _outbuf, outbytesleft, 0);
|
||||
}
|
||||
|
||||
size_t iconv_ucs2be_to_utf8(char **_inbuf, size_t *inbytesleft, char **_outbuf, size_t *outbytesleft)
|
||||
{
|
||||
return enc_unicode_to_utf8(_inbuf, inbytesleft, _outbuf, outbytesleft, 1);
|
||||
}
|
||||
|
||||
17
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/xmake.lua
vendored
Normal file
17
sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/iconv/xmake.lua
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
target("iconv")
|
||||
local LIB_DIR = "$(buildir)/iconv/"
|
||||
set_kind("static")
|
||||
set_targetdir(LIB_DIR)
|
||||
|
||||
--加入代码和头文件
|
||||
add_includedirs("./",{public = true})
|
||||
add_files("./*.c",{public = true})
|
||||
--路径可以随便写,可以加任意路径的代码,下面代码等效上方代码
|
||||
-- add_includedirs(SDK_TOP .. "project/" .. TARGET_NAME .. "/inc",{public = true})
|
||||
-- add_files(SDK_TOP .. "project/" .. TARGET_NAME .. "/src/*.c",{public = true})
|
||||
|
||||
--可以继续增加add_includedirs和add_files
|
||||
--自动链接
|
||||
--LIB_USER = LIB_USER .. SDK_TOP .. LIB_DIR .. "libiconv.a "
|
||||
target_end()
|
||||
Reference in New Issue
Block a user