資源簡介
此程序為C語言源代碼,提供了GBK到UTF8格式轉化的函數,可直接調用,不需要任何庫。
代碼片段和文件信息
#include“gbkuni30_gen.h“
#include?
#include?
#include?
int?gbk_to_unicode(unsigned?short?int*?unicode?const?char*?gbk?int?len)
{
????int?ij;
????i?=?0;
????unsigned?char*?gb_temp?=?(unsigned?char?*)gbk;?
????for(j?=?0;?i?????{
????????if?(gb_temp[i]?<=?0x80)
????????{
????????????unicode[j]?=?gb_temp[i];
????????????i++;
????????}
????????else
????????{
????????????unsigned?short?int?temp;
????????????temp?=?(gb_temp[i]?<8)?+?gb_temp[i+1];
????????????unicode[j]?=?gbkuni30[temp];
????????????i?+=?2;
????????}
????}
????return?j;
}
int?enc_unicode_to_utf8_one(unsigned?long?unic?unsigned?char?*pOutput)?
{??
???
??
????if?(?unic?<=?0x0000007F?)??
????{??
????????//?*?U-00000000?-?U-0000007F:??0xxxxxxx??
????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????593028??2016-11-18?17:12??gbk_utf8\gbk_utf8程序\gbkuni30_gen.h
?????文件???????3240??2016-11-22?18:24??gbk_utf8\gbk_utf8程序\gbk_to_utf8.c
?????文件????????233??2016-11-22?18:38??gbk_utf8\gbk_utf8程序\readme.txt
?????文件?????240424??2016-11-18?15:20??gbk_utf8\生成查詢表頭文件程序\gbkuni30.txt
?????文件???????1737??2016-11-22?18:19??gbk_utf8\生成查詢表頭文件程序\gen_gbkuni_main.c
?????文件????????106??2016-11-22?18:30??gbk_utf8\生成查詢表頭文件程序\readme.txt
?????目錄??????????0??2016-11-22?18:31??gbk_utf8\gbk_utf8程序
?????目錄??????????0??2016-11-22?18:26??gbk_utf8\生成查詢表頭文件程序
?????目錄??????????0??2016-11-22?18:26??gbk_utf8
-----------?---------??----------?-----??----
???????????????838768????????????????????9
評論
共有 條評論