int iTextLen;
iTextLen = WideCharToMultiByte ( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL);
pElementText = new char[iTextLen + 1];
memset( ( void* )pElementText, 0, sizeof( char ) * ( iTextLen + 1 ) );
::WideCharToMultiByte( CP_UTF8,0,str,-1,pElementText,iTextLen,NULL,NULL );