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

¹ØÓÚ linux ÖÐ iconv() º¯Êý µÄÎÊÌâ

×î½üÔÚдspider ÐèÒªÒª½â¾ö ±àÂëת»» ÎÊÌâ  Óõ½  iconv() º¯Êý 

µ«Ò²²»ÖªµÀ ÄÄÀïÓÐÎÊÌâ  ÀÏÊÇÕû²»³öÀ´  ÄÄλ´óÏÀ  °ï°ïæ 

´úÂë  ÈçÏ£º£¨Í·Îļþû¸´ÖÆ£©

//CodeConvert.cpp

#include "CodeConvert.h"
#include "stdlib.h"
#include <string.h>
#include <errno.h>

CCodeConv::CCodeConv(const char *from_charset,const char *to_charset)
{
cd=iconv_open(to_charset,from_charset);
if( cd== (iconv_t) -1 )
{
cout < <"cannot open iconv discripter!" < <endl;
iconv_close(cd);
exit(0);
}
}

CCodeConv::~CCodeConv()
{
iconv_close(cd);
}

bool CCodeConv::Convert(char *inbuf,long inlen,char *outbuf,long outlen)
{
char **pin=&inbuf;
char **pout=&outbuf;
memset(outbuf,0,outlen);
if( -1==iconv(cd,pin,(size_t *)&inlen,pout,(size_t *)&outlen) )
{
cout < <"have error in iconv()!" < <endl;
cout < <errno < <" " < <strerror(errno) < <endl;
return false;
}
return true;
}


#include "CodeConvert.h"
#include <string.h>

int main()
{
char *in="Íõ";


Ïà¹ØÎÊ´ð£º

Ë­Äܸø¸öLinuxÏÂдC/C++³ÌÐòµÄ½Ì³Ì£¿

¸ø¸öµØÖ·£¬»òÕß·¢µ½ÎÒÓÊÏäÒ²ÐÐ wrongagain98@163.com
×îºÃÊÇÊÓÆµµÄ£¬²»ÊÇÊÓÆµÆÕͨµÄÒ²ÐС£

Ö÷ÒªÊÇÁ½·½Ã棺
1.ÔõÑù±à¼­¡¢±àÒëºÍµ÷ÊÔ³ÌÐò¡£Ï£ÍûÄÜÒ»²½²½½²Çå³þ£¬ÈçºÎ°²×°¡¢ÈçºÎÅäÖõȡ£²»Òª¾Íֻ˵¾ä¡°¾ÍÓ ......

linux³ÌÐò´ò²»¿ªÍ·Îļþ

#include <fcnt1.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc,char *argv[])
{
  int fd_open,fd_open_create,fd_create;
  if((fd_open=o ......

ÈçºÎÔÚLinuxϰ²×°cuda visual profiler

ÇëÎÊÏÂÔØLinuxÏÂÔõô°²×°cuda visual profiler°¡£¿
ÁíÍ⣬ÎÒÖ»ÏÂÔØµ½1.0°æ±¾µÄprofiler£¬Ã»ÕÒµ½2.2°æ±¾µÄ£¨ÎÒÓõÄcudaÊÇ2.2°æ±¾µÄ£©£¬²»ÖªµÀÈ¥ÄĶùÏÂÔØ£¿
¶àл£¡

ÎÒÖªµÀÁË£¬ÆäʵÔÚ°²×°cudaµÄʱºò¾ÍÒѾ­×°ÁË ......

ÔÚlinuxÉÏʹÓÃtomcat·þÎñÆ÷³öÏÖÁ˺ܶàclose_wait

ÔÚlinuxÉÏʹÓÃtomcat·þÎñÆ÷³öÏÖÁ˺ܶàclose_wait

ʹÓÃä¯ÀÀÆ÷·ÃÎʵÄʱºò³öÏÖÒ³ÃæÒ»Ö±ÔÚÇëÇ󣬺ÜÂý £¬»ù±¾ÉÏûÓлØÓ¦¡£
ÓÃnetstat -anp ²é¿´ Óкܶàclose_wait


Õâ¸öÊÇʲôÒýÆðµÄ°¢ £¬Ôõô½â¾ö£¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ