Because the C program used to update the postgreSQL database content is recently, PostgreSQL uses UTF-8 encoding, so you need to do coding conversion, of course, I concurse ICONV, write a function. Turns the pass on the redhat AS3.
String GB18030_TO_UTF_8 (const string & src) {string re; const char * sfrom = src.c_str (); size_t slen = Strlen (SFROM); if (Slen> (SIZE_T) 800) {SLEN = 800;} Iconv_t Cd; IF (CD = ICONV_OPEN ("UTF-8", "GB18030")) <0) RETURN RE; Char * SIN = (Char *) SFROM; char STO [800] = {0}; char * DOUT = STO; SIZE_T DLEN = 800; IF (ICONV (CD, & Sin, & Slen, & Dout, & Dlen <0) Return Re; Iconv_Close (CD); RE = STO; RETURN RE;}