nsAutoString str( charset ); const char *s=NS_ConvertUCS2toUTF8(str).get();  strcpy( (char*)argt->value, s );
strcpy( (char*)argt->value, NS_ConvertUCS2toUTF8(charset).get() );
static int mozilla_get_info(PtWidget_t *widget, PtArg_t *argt){	PtMozillaWidget_t *moz = (PtMozillaWidget_t *) widget;	int retval;	switch (argt->type)	{		case Pt_ARG_MOZ_NAVIGATE_PAGE:			moz->MyBrowser->WebNavigation->GetCanGoBack(&retval);			moz->navigate_flags = 0;			if (retval)				moz->navigate_flags |= ( 1 << WWW_DIRECTION_BACK );			moz->MyBrowser->WebNavigation->GetCanGoForward(&retval);			if (retval)				moz->navigate_flags |= ( 1 << WWW_DIRECTION_FWD );			*((int **)argt->value) = &moz->navigate_flags;			break;		case Pt_ARG_MOZ_OPTION:			mozilla_get_pref( widget, (char*)argt->len, (char*) argt->value );			break;		case Pt_ARG_MOZ_GET_CONTEXT:			if( moz->rightClickUrl ) strcpy( (char*) argt->value, moz->rightClickUrl );			else *(char*) argt->value = 0;			break;		case Pt_ARG_MOZ_ENCODING: {			PRUnichar *charset = nsnull;			moz->MyBrowser->mPrefs->GetLocalizedUnicharPref( "intl.charset.default", &charset );			nsAutoString str( charset );			const char *s=NS_ConvertUCS2toUTF8(str).get();			strcpy( (char*)argt->value, s );			}			break;		case Pt_ARG_MOZ_GET_HISTORY: {			WWWRequest *req = ( WWWRequest * ) argt->len;			PtWebClientHistoryData_t *HistoryReplyBuf = (PtWebClientHistoryData_t *) argt->value;			int i, j;			PRInt32 total;			moz->MyBrowser->mSessionHistory->GetCount( &total );			for( i=total-2, j=0; i>=0 && j<req->History.num; i--, j++) {				nsIHistoryEntry *entry;				moz->MyBrowser->mSessionHistory->GetEntryAtIndex( i, PR_FALSE, &entry );							PRUnichar *title;				nsIURI *url;				entry->GetTitle( &title );				entry->GetURI( &url );				nsString stitle( title );			  strncpy( HistoryReplyBuf[j].title, stitle.ToNewCString(), 127 );			  HistoryReplyBuf[j].title[127] = '\0';				char *urlspec;				url->GetSpec( &urlspec );			  strcpy( HistoryReplyBuf[j].url, urlspec );			  }			}			break;	}	return (Pt_CONTINUE);}