Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

phpº¯ÊýÖв»ÖªµÀÔõôÔÚCÖе÷ÓÃ? htmlʵÌåÓëÍøÒ³±àÂë

mb_convert_encoding ("ÄãºÃ", "HTML-ENTITIES", "gb2312");    //Êä³ö£º你好
mb_convert_encoding ("你好", "gb2312", "HTML-ENTITIES");    //Êä³ö£ºÄãºÃ

ÉÏÃæÊÇphpº¯Êý,ÔÚc/c++ÖÐÔõôʵÏÖÕâÑù±àÂë?
20320ºÍ22909·Ö±ðÊÇ¡°Ä㡱¡°ºÃ¡±Õâ2¸ö×ÖµÄunicodeÂëÖµ¡£
ËùÒÔÕâô×ö¼´¿É£º
C/C++ code:

char* ConvertGBKToEncodeStr( const char* strGBK )
{

int len=MultiByteToWideChar(936, 0, strGBK, -1, NULL,0);
int i;
WCHAR * wszUCD = new WCHAR[len+1];
memset(wszUtf8, 0, len * 2 + 2);
MultiByteToWideChar(936, 0, strGBK, -1, wszUCD, len);
char *strEncode = new char[len*8+1];
for (i=0;i<wcslen(wszUCD); i++)
{
sprintf(strEncode+strlen(strEncode), "&#%d;", wczUCD[i]);
}
delete[] wszUCD;
return strEncode;


Õâ¸öÊǰÑ"ÄãºÃ" תΪ&#20320;&#22909;
·´Ïò¸ü¼òµ¥£¬Ö±½ÓÌáÈ¡&#ºÍ;Ö®¼äµÄÊý×Ö£¬¸³¸øwchar_tÊý×é¼´¿É¡£

ÓÃiconv

phpº¯ÊýµÄÔ´Â룬¶¼ÊÇ´¿CµÄ£¬¿ÉÒԲο¼

#include <iomanip>
#include <iostream>
#include <string.h>
#include <iconv.h>
#include <locale.h>
#include <stdlib.h>
//#include <easycics>

#define HG_LA


Ïà¹ØÎÊ´ð£º

Á½¸öCÎļþµÄÎÊÌâ

ÒÔǰÔÚVCÀïÃæ½¨Ò»¸ö¹¤³Ì£¬¶¼Ö»ÓÃÒ»¸ö .c Îļþ£¬×òÌìÔÚÒ»¸ö¹¤³ÌÀïÓÃÁËÁ½¸ö .cÎļþÁË£¬Óöµ½ÎÊÌâÁË£¬Çë´ó¼ÒÖ¸µã¡£±ÈÈ磺
File1.c Fil ......

ʹÓÃCµÄ¸ßÊÖÇë½ø

´ó¼ÒºÃ£¡ÎÒÊÇһλC°®ºÃÕߣ¬Ïò´ó¼ÒÇë½ÌÏ£¬C³ÌÐòÔ±¿ÉºÃÕÒ¹¤×÷£¿¹«Ë¾ÓÃC¸ÉЩʲô£¿
ÎÞËùνºÃ²»ºÃÕÒ¹¤×÷£¬Ò»°ãͨÐÅ¡¢ÏµÍ³¡¢Ç¶Èëʽ¡¢Ó²¼þ·½ÃæÓõĶ࣬¶øÇÒÓÉÓÚCµÄµ×²ãÌØÐÔ£¬Ñ§»áºóÔÚѧÆäËûµÄ»á±È½ÏÈÝÒ×

²»¹ÜÓÃʲôÓï ......

ÄϾ© ÖÐÐË C³ÌÐòÔ±ÕÐÆ¸

¹¤×÷ÄÚÈÝ Ñз¢

×ʸñÒªÇó£º
211ºÍÖØµãԺУ±¾¿Æ 3Ä깤×÷¾­Ñé
211ºÍÖØµãԺУ˶ʿ 1Ä깤×÷¾­Ñé

ÆÕͨԺУÔÚ¹¤×÷ÄêÏÞÉϸ÷¼Ó1Äê


ÓÐͨÐÅÏà¹Ø¿ª·¢¾­ÑéÕßÓÅÏÈ£¬µ±È»C/C++ »ù´¡ÒªÔúʵ

à ......

C#µ÷Óà C DLLÎÊÌ⣬¶®µÄÀ´ÇÀ·ÖÁË

//C ½Ó¿Ú
extern "C"
{
  TESSDLL_API int __cdecl GetTessText(const char *imagefile, char *text);  
}
//ÎÒÔÚC#ÖÐÉùÃ÷
//µ÷ÓÃC DLL Öеĺ¯Êý
[DllImport("OCRapi.dll&quo ......

CÖеÄһЩСÎÊÌâ¡£¡£¡£

/* Note:Your choice is C IDE

×÷Óãº Ëæ»úÊý¼ÓÃÜ·¨£¬£¬£¬£¬
ÒÔÏÂÓÐÐí¶à²»¶®£¬Çë½Ìһϣ¬ÇëÖ÷Òâ´úÂë;
*/
#include <stdio.h>
#include <stdlib.h>
union
{
int value;
struct
{
c ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ