#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iconv.h>
int code_convert(char *from_charset,char *to_charset,char *inbuf,int inlen,char *outbuf,int outlen)
{
iconv_t cd;
int rc;
char **pin = &inbuf;
char **pout = &outbuf;
cd = iconv_open(to_charset,from_charset);
if (cd==0)
{
printf("no support\n");
return -1;
}
memset(outbuf,0,outlen);
if (iconv(cd,pin,&inlen,pout,&outlen) == -1)
{
printf("conv error\n");
return -1;
}
iconv_close(cd);
return 0;
}
int u2g(char *inbuf,int inlen,char *outbuf,int outlen)
{
return code_convert("utf-8","#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iconv.h>
int code_convert(char *from_charset,char *to_charset,char *inbuf,int inlen,char *outbuf,int outlen)
{
iconv_t cd;
int rc;
char **pin = &inbuf;
char **pout = &outbuf;
cd = iconv_open(to_charset,from_charset);
if (cd==0)
{
printf("no support\n");
return -1;
}
memset(outbuf,0,outlen);
if (iconv(cd,pin,&inlen,pout,&outlen) == -1)
{
printf("conv error\n");
return -1;
}
iconv_close(cd);
return 0;
}
int u2g(char *inbuf,int inlen,char *outbuf,int outlen)
{
return code_convert("utf-8","gb18030",inbuf,inlen,outbuf,outlen);
}
int g2u(char *inbuf,size_t inlen,char *outbuf,size_t outlen)
{
return code_convert("gb18030","utf-8",inbuf,inlen,outbuf,outlen);
}
int main()
{
char str_in[] = "王弢";
char str_out[6] = {'1'};
u2g(str_in, strlen(str_in), str_out, 4);
printf("%d\n", strlen(str_out));
printf("%d\n", strchr(str_out, '|') - str_out);
return 0;
}",inbuf,inlen,outbuf,outlen);
}
int g2u(char *inbuf,size_t inlen,char *outbuf,size_t outlen)
{
return code_convert("gb18030","utf-8",inbuf,inlen,outbuf,outlen);
}
int main()
{
char str_in[] = "王弢";
char str_out[6] = {'1'};
u2g(str_in, strlen(str_in), str_out, 4);
printf("%d\n", strlen(str_out));
printf("%d\n", strchr(str_out, '|') - str_out);
return 0;
}
Tuesday, 10 September 2013
Friday, 12 July 2013
Smoke testing
Heard this word from PM, wonder what's it.
Got it from wiki page.
http://en.wikipedia.org/wiki/Smoke_testing
now some general understanding now.
Smoke testing refers to physical tests made to closed systems of pipes to detect cracks or breaks. By metaphorical extension, the term is also used for the first test made after assembly or repairs to a system, to provide some assurance that the system under test will not catastrophically fail. After a smoke test proves that "the pipes will not leak, the keys seal properly, the circuit will not burn, or the software will not crash outright,"[citation needed] the system is ready for more robust testing.
The term smoke testing is used in several fields, including electronics, software development, plumbing, woodwind repair, infectious disease control, and the entertainment industry.
Got it from wiki page.
http://en.wikipedia.org/wiki/Smoke_testing
now some general understanding now.
Smoke testing refers to physical tests made to closed systems of pipes to detect cracks or breaks. By metaphorical extension, the term is also used for the first test made after assembly or repairs to a system, to provide some assurance that the system under test will not catastrophically fail. After a smoke test proves that "the pipes will not leak, the keys seal properly, the circuit will not burn, or the software will not crash outright,"[citation needed] the system is ready for more robust testing.
The term smoke testing is used in several fields, including electronics, software development, plumbing, woodwind repair, infectious disease control, and the entertainment industry.
Thursday, 27 June 2013
How to AutoFit Column Width or Height in Excel
Click the "Format" drop-down menu in the "Cells" group of
the "Home" tab.
Select the "AutoFit Column Width" option in the "Cell Size" section.
or "AutoFit Row Height"
That's easy!
Select the "AutoFit Column Width" option in the "Cell Size" section.
or "AutoFit Row Height"
That's easy!
Subscribe to:
Comments (Atom)