您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ utf8_to_unicode函数代码示例

51自学网 2021-06-03 09:24:09
  C++
这篇教程C++ utf8_to_unicode函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中utf8_to_unicode函数的典型用法代码示例。如果您正苦于以下问题:C++ utf8_to_unicode函数的具体用法?C++ utf8_to_unicode怎么用?C++ utf8_to_unicode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了utf8_to_unicode函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: NCVertDialog

ReplaceEditParamDialog::ReplaceEditParamDialog(NCDialogParent *parent, ReplaceEditParams *params):	NCVertDialog(::createDialogAsChild, 0, parent, utf8_to_unicode(_LT("Replace")).ptr(), bListOkCancel),	iL(16, 3),	fromText(0, this, utf8_to_unicode(_LT("Search for:")).ptr()),	toText(0, this, utf8_to_unicode(_LT("Replace with:")).ptr()),	fromEdit	(0, this, 0, 0, 50),	toEdit	(0, this, 0, 0, 50),	caseButton(0, this, utf8_to_unicode(_LT("Case sensitive")).ptr(), 0, params->sens){	if (params->from.ptr()) fromEdit.SetText(params->from.ptr(), true);	if (params->to.ptr()) toEdit.SetText(params->to.ptr(), true);		iL.AddWin(&fromText,	0, 0); fromText.Enable(); fromText.Show();	iL.AddWin(&toText,	1, 0); toText.Enable(); toText.Show();		iL.AddWin(&fromEdit,	0, 1); fromEdit.Enable(); fromEdit.Show(); 	fromEdit.SetFocus();		iL.AddWin(&toEdit,	1, 1); toEdit.Enable(); toEdit.Show(); 		iL.AddWin(&caseButton, 2, 1); caseButton.Enable(); caseButton.Show(); 		AddLayout(&iL);	SetEnterCmd(CMD_OK);		order.append(&fromEdit);	order.append(&toEdit);	order.append(&caseButton);		SetPosition();}
开发者ID:carriercomm,项目名称:WalCommander,代码行数:31,


示例2: CopyDialog

	CopyDialog(NCDialogParent *parent, bool move = false)	:	SimpleCFThreadWin(parent, move ? _LT("Move") : _LT("Copy") ),		_layout(7,2), 		_text1(0, this, utf8_to_unicode(move ? _LT("Moving the file") : _LT("Copying the file") ).ptr()),		_text2(0, this, utf8_to_unicode( _LT("to") ).ptr()),		_text3(0, this, utf8_to_unicode( _LT("Files processed") ).ptr()),		_from(this),		_to(this),		_countWin(this), 		_progressWin(this)	{		_layout.AddWin(&_text1, 0, 0, 0, 1);		_layout.AddWin(&_from, 1, 0, 1, 1);		_layout.AddWin(&_text2, 2, 0, 2, 1);		_layout.AddWin(&_to, 3, 0, 3, 1);		_layout.AddWin(&_progressWin, 4,0,4,1);		_layout.AddWin(&_text3, 5, 0);		_layout.AddWin(&_countWin, 5, 1);		_text1.Show(); _text1.Enable();		_text2.Show(); _text2.Enable();		_text3.Show(); _text3.Enable();		_from.Show(); _from.Enable();		_to.Show(); _to.Enable();		_countWin.Show(); _countWin.Enable();		_progressWin.Show(); _progressWin.Enable();		AddLayout(&_layout);		SetPosition();	}
开发者ID:Karamax,项目名称:WalCommander,代码行数:28,


示例3: UiGetColor

void CharsetListWin::DrawItem(wal::GC &gc, int n, crect rect){	if (cList && n >= 0 && n < cCount)	{		bool frame = false;				UiCondList ucl;		if ((n % 2)==0) ucl.Set(uiOdd, true);		if (n == this->GetCurrent()) ucl.Set(uiCurrentItem, true);				unsigned bg = UiGetColor(uiBackground, uiItem, &ucl, 0xFFFFFF);		unsigned textColor = UiGetColor(uiColor, uiItem, &ucl, 0);		unsigned frameColor = UiGetColor(uiFrameColor, uiItem, &ucl, 0);;		if (n == this->GetCurrent())			frame = true;					gc.SetFillColor(bg);		gc.FillRect(rect);		gc.Set(GetFont());		int x = 0;		const unicode_t *txt = 0;		gc.SetTextColor(textColor);		gc.TextOutF(rect.left+10, rect.top+2, utf8_to_unicode(cList[n]->name).ptr());		gc.TextOutF(rect.left+10+15*fontW, rect.top+2, utf8_to_unicode(cList[n]->comment).ptr() );	} else {		gc.SetFillColor(UiGetColor(uiBackground, uiItem, 0, 0xFFFFFF));		gc.FillRect(rect);	}}
开发者ID:Karamax,项目名称:WalCommander,代码行数:32,


示例4: KbIntCallback

void KbIntCallback(   const char* name, int name_len,   const char* instruction, int instruction_len,   int num_prompts,   const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts,   LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses,   void** anstract ){	if ( num_prompts <= 0 ) { return; }	if ( !kbdIntInfo ) { return; }	try	{		std::vector<FSPromptData> pData( num_prompts );		int i;		for ( i = 0; i < num_prompts; i++ )		{			pData[i].visible = prompts[i].echo != 0;			pData[i].prompt = utf8_to_unicode( CopyToStrZ( prompts[i].text, prompts[i].length ).data() ).data();		}		static unicode_t userSymbol = '@';		if ( !kbdIntInfo->Prompt(		        utf8_to_unicode( "SFTP" ).data(),		        carray_cat<unicode_t>( kbdIntParam->user.Data(), &userSymbol, kbdIntParam->server.Data() ).data(),		        pData.data(), num_prompts ) ) { return; }		for ( i = 0; i < num_prompts; i++ )		{			std::vector<char> str = new_char_str( ( char* )FSString( pData[i].prompt.Data() ).Get( kbdIntParam->charset ) );			if ( str.data() )			{				int l = strlen( str.data() );				responses[i].length = l;				responses[i].text = ( char* ) malloc( l + 1 );				if ( responses[i].text ) { strcpy( responses[i].text, str.data() ); }			}		}	}	catch ( cexception* ex )	{		fprintf( stderr, "exception in kbdint callback used with libssh2: %s/n", ex->message() );		ex->destroy();	}	catch ( ... )	{		fprintf( stderr, "excention (...) in kbdint callback used with libssh2/n" );	}}
开发者ID:KonstantinKuklin,项目名称:WalCommander,代码行数:57,


示例5: Add

void clMenuData::Add( const char* utf8name, const char* utf8coment1, const char* utf8coment2, int cmd, int icon ){	Add( utf8name ? utf8_to_unicode( utf8name ).data() : 0,	     utf8coment1 ? utf8_to_unicode( utf8coment1 ).data() : 0,	     utf8coment2 ? utf8_to_unicode( utf8coment2 ).data() : 0,	     cmd,	     icon	   );}
开发者ID:FaionWeb,项目名称:WCMCommander,代码行数:9,


示例6: CharsetDlg1

	CharsetDlg1(NCDialogParent *parent, int curCharset)	:	NCDialog(createDialogAsChild, 0, parent, utf8_to_unicode( _LT("Charset") ).ptr(), bListOkCancel), 		layout(10,10),		list(this, 7),		otherButton(0, this, utf8_to_unicode( _LT("Other...") ).ptr(), CMD_OTHER),		addButton(0, this, utf8_to_unicode( carray_cat<char>(_LT("Add..."), "(Ins)").ptr() ).ptr(), CMD_ADD),		delButton(0, this, utf8_to_unicode( carray_cat<char>(_LT("Del..."), "(Del)").ptr() ).ptr(), CMD_DEL)	{ 		int i;		InitOperCharsets();		list.SetList(::csList.ptr(), ::csList.count());		list.MoveFirst(0);		for (int i = 0; i < ::csList.count(); i++) 			if (::csList[i]->id == curCharset) {				list.MoveCurrent(i);				break;			}				/*			LO			L			LA			LD		*/		layout.AddWin(&list,0,0,3,0); list.Enable(); list.Show(); 		list.SetFocus();		layout.AddWin(&otherButton,0,1); otherButton.Enable(); otherButton.Show();		layout.AddWin(&addButton,2,1); addButton.Enable(); addButton.Show();		layout.AddWin(&delButton,3,1); delButton.Enable(); delButton.Show();		int mx = 0, my = 0;		LSize ls;		otherButton.GetLSize(&ls); if (mx < ls.x.maximal) mx = ls.x.maximal; if (my < ls.y.maximal) my = ls.y.maximal;		addButton.GetLSize(&ls); if (mx < ls.x.maximal) mx = ls.x.maximal;	if (my < ls.y.maximal) my = ls.y.maximal;		delButton.GetLSize(&ls); if (mx < ls.x.maximal) mx = ls.x.maximal;	if (my < ls.y.maximal) my = ls.y.maximal;		ls.x.minimal = ls.x.maximal = mx;		ls.y.minimal = ls.y.maximal = my;		otherButton.SetLSize(ls);		addButton.SetLSize(ls);		delButton.SetLSize(ls);		layout.SetLineGrowth(1);		AddLayout(&layout);		SetEnterCmd(CMD_OK);		SetPosition();	};
开发者ID:Karamax,项目名称:WalCommander,代码行数:50,


示例7: NCDialog

CmdHistoryDialog::CmdHistoryDialog( int nId, NCDialogParent* parent, NCHistory& history )	:  NCDialog( createDialogAsChild, nId, parent, utf8_to_unicode( " History " ).data(), bListOkCancel ),	   _history( history ),	   _selected( history.Count() - 1 ),	   _list( Win::WT_CHILD, Win::WH_TABFOCUS | WH_CLICKFOCUS, 0, this, VListWin::SINGLE_SELECT, VListWin::BORDER_3D, 0 ){	for ( int i = _history.Count() - 1; i >= 0; i-- ) { _list.Append( _history[i] ); }	_list.Enable();	_list.Show();	_list.SetFocus();	LSRange h( 10, 1000, 10 );	LSRange w( 50, 1000, 30 );	_list.SetHeightRange( h ); //in characters	_list.SetWidthRange( w ); //in characters	if ( _history.Count() > 0 )	{		_list.MoveFirst( 0 );		_list.MoveCurrent( _history.Count() - 1 );	}	AddWin( &_list );	SetEnterCmd( CMD_OK );	SetPosition();};
开发者ID:FaionWeb,项目名称:WCMCommander,代码行数:27,


示例8: close

bool Directory::open(const char * dirname){    close();    if (nullptr == dirname || '/0' == dirname[0])    {        return(false);    }    m_dir_name = dirname;    if ('/' != *m_dir_name.rbegin() && '//' != *m_dir_name.rbegin())    {        m_dir_name += g_directory_separator;    }#ifdef _MSC_VER    std::wstring pattern(utf8_to_unicode(m_dir_name) + L"*");    m_dir = FindFirstFileW(pattern.c_str(), &m_file);    if (INVALID_HANDLE_VALUE == m_dir)    {        return(false);    }    m_eof = false;#else    m_dir = opendir(utf8_to_ansi(m_dir_name).c_str());    if (nullptr == m_dir)    {        return(false);    }    m_file = readdir(m_dir);#endif // _MSC_VER    return(true);}
开发者ID:yanrk,项目名称:stupid,代码行数:34,


示例9: ocrwords_add_word

/*** Allocates new space for text buffer.*/void ocrwords_add_word(OCRWORDS *words,OCRWORD *word)    {    static char *funcname="ocrwords_add_word";    int i;    if (words->n>=words->na)        {        int newsize;              newsize = words->na<512 ? 1024 : words->na*2;        willus_mem_realloc_robust_warn((void **)&words->word,newsize*sizeof(OCRWORD),                                    words->na*sizeof(OCRWORD),funcname,10);        for (i=words->na;i<newsize;i++)            ocrword_init(&words->word[i]);        words->na=newsize;        }    words->word[words->n]=(*word);    words->word[words->n].text=NULL;    willus_mem_alloc_warn((void **)&words->word[words->n].text,strlen(word->text)+1,funcname,10);    strcpy(words->word[words->n].text,word->text);    /* Copy char positions */    words->word[words->n].n=utf8_to_unicode(NULL,word->text,1000000);    if (word->cpos!=NULL)        {        willus_mem_alloc_warn((void **)&words->word[words->n].cpos,                       words->word[words->n].n*sizeof(double),funcname,10);        for (i=0;i<words->word[words->n].n;i++)            words->word[words->n].cpos[i] = word->cpos[i];        }    else        words->word[words->n].cpos=NULL;    words->n++;    }
开发者ID:FauxFaux,项目名称:k2pdfopt,代码行数:37,


示例10: do_op_right

static intdo_op_right(struct form_state *fs, struct line_info *line, int current, int utf8){	unsigned char *text, *end;	int old_state;	if (!utf8) {		/* TODO: zle */		fs->state = int_min(fs->state + 1, strlen(fs->value));		return 0;	}	if (fs->state_cell) {		fs->state_cell = 0;		return 0;	}	text = fs->value + fs->state;	end = strchr((const char *)text, '/0');	old_state = fs->state;	utf8_to_unicode(&text, end);	fs->state = text - fs->value;	if (old_state != fs->state && line[current].split_next) {		fs->state_cell = (fs->state == line[current].end) ? old_state:0;	} else if (!line[current].split_next) {		fs->state_cell = 0;	}	return 0;}
开发者ID:Efreak,项目名称:elinks,代码行数:32,


示例11: updpos

/* * updpos: *	update the position of the hardware cursor and handle extended *	lines. This is the only update for simple moves. */void updpos(void){	struct line *lp;	int i;	/* find the current row */	lp = curwp->w_linep;	currow = curwp->w_toprow;	while (lp != curwp->w_dotp) {		++currow;		lp = lforw(lp);	}	/* find the current column */	curcol = 0;	i = 0;	while (i < curwp->w_doto) {		unicode_t c;		int bytes;		bytes = utf8_to_unicode(lp->l_text, i, curwp->w_doto, &c);		i += bytes;		if (c == '/t')			curcol |= tabmask;		++curcol;	}	/* if extended, flag so and update the virtual line image */	if (curcol >= term.t_ncol - 1) {		vscreen[currow]->v_flag |= (VFEXT | VFCHG);		updext();	} else		lbound = 0;}
开发者ID:ChunHungLiu,项目名称:uemacs,代码行数:40,


示例12: tiogetc

/* * tiogetc: */int tiogetc(void){        static char buffer[32];        static int pending;        unicode_t c;        int count, bytes = 1, expected;        count = pending;        if (!count) {                count = read(0, buffer, sizeof(buffer));                if (count <= 0)                        return 0;                pending = count;        }        c = (unsigned char )buffer[0];        if (c >= 32 && c < 238)                goto done;        /* We need UTF8 sequences that start with 0xeo */        expected = 2;        if ((c & 0xe0) == 0xe0)                expected = 6;        if (count < expected) {                int n;                /* set timeout */                new_termios.c_cc[VMIN] = 0;                new_termios.c_cc[VTIME] = 1;                tcsetattr(0, TCSANOW, &new_termios);                n = read(0, buffer + count, sizeof(buffer) - count);                /* unset timeout */                new_termios.c_cc[VMIN] = 1;                new_termios.c_cc[VTIME] = 0;                tcsetattr(0, TCSANOW, &new_termios);                if (n > 0)                        pending += n;        }        if (pending > 1) {                unsigned char second = buffer[1];                /* XXX;  */        }        bytes = utf8_to_unicode(buffer, 0, pending, &c);done:        pending -= bytes;        memmove(buffer, buffer+bytes, pending);        return c;}
开发者ID:ajaysusarla,项目名称:cgol,代码行数:61,


示例13: new_char_str

void SysOptDialog::SetCurLang(const char *id){	curLangId = new_char_str(id);	if (id[0] == '-')		langVal.SetText( utf8_to_unicode( _LT("English") ).ptr() );	else if (id[0]=='+') 		langVal.SetText( utf8_to_unicode( _LT("Autodetect") ).ptr() );	else {		for (int i = 0; i<list.count(); i++)		{			if (!strcmp(list[i].id.ptr(), id)) {				langVal.SetText( utf8_to_unicode( list[i].name.ptr() ).ptr() );				return;			}		}		langVal.SetText( utf8_to_unicode( id ).ptr() );	}}
开发者ID:Karamax,项目名称:WalCommander,代码行数:18,


示例14: show_line

static void show_line(struct line *lp){	int i = 0, len = llength(lp);	while (i < len) {		unicode_t c;		i += utf8_to_unicode(lp->l_text, i, len, &c);		vtputc(c);	}}
开发者ID:ChunHungLiu,项目名称:uemacs,代码行数:10,


示例15: clFileAssociationsWin

	clFileAssociationsWin( NCDialogParent* parent, std::vector<clNCFileAssociation>* Associations )		: NCDialog( ::createDialogAsChild, 0, parent, utf8_to_unicode( _LT( "File associations" ) ).data(), bListOkCancel )		, m_ListWin( this, Associations )		, m_Layout( 10, 10 )		, m_AddCurrentButton( 0, this, utf8_to_unicode( "+ (&Ins)" ).data(), CMD_PLUS )		, m_DelButton( 0, this, utf8_to_unicode( "- (&Del)" ).data(), CMD_MINUS )		, m_EditButton( 0, this, utf8_to_unicode( _LT( "&Edit" ) ).data(), CMD_EDIT )		, m_Saved( true )	{		m_AddCurrentButton.Enable();		m_AddCurrentButton.Show();		m_DelButton.Enable();		m_DelButton.Show();		m_EditButton.Enable();		m_EditButton.Show();		LSize lsize = m_AddCurrentButton.GetLSize();		LSize lsize2 = m_DelButton.GetLSize();		LSize lsize3 = m_EditButton.GetLSize();		if ( lsize.x.minimal < lsize2.x.minimal ) { lsize.x.minimal = lsize2.x.minimal; }		if ( lsize.x.minimal < lsize3.x.minimal ) { lsize.x.minimal = lsize3.x.minimal; }		if ( lsize.x.maximal < lsize.x.minimal ) { lsize.x.maximal = lsize.x.minimal; }		m_AddCurrentButton.SetLSize( lsize );		m_DelButton.SetLSize( lsize );		m_EditButton.SetLSize( lsize );		m_Layout.AddWinAndEnable( &m_ListWin, 0, 0, 9, 0 );		m_Layout.AddWin( &m_AddCurrentButton, 0, 1 );		m_Layout.AddWin( &m_DelButton, 1, 1 );		m_Layout.AddWin( &m_EditButton, 2, 1 );		m_Layout.SetLineGrowth( 9 );		this->AddLayout( &m_Layout );		SetPosition();		m_ListWin.SetFocus();		this->SetEnterCmd( CMD_OK );	}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:43,


示例16: NCVertDialog

PanelOptDialog::PanelOptDialog(NCDialogParent *parent):	NCVertDialog(::createDialogAsChild, 0, parent, utf8_to_unicode( _LT( "Panel settings") ).ptr(), bListOkCancel),	iL(16, 3),	showHiddenButton(0, this, utf8_to_unicode( _LT("Show hidden files") ).ptr(), 0, wcmConfig.panelShowHiddenFiles),	showIconsButton(0, this, utf8_to_unicode( _LT("Show icons") ).ptr(), 0, wcmConfig.panelShowIcons),	caseSensitive(0, this, utf8_to_unicode( _LT("Case sensitive sort") ).ptr(), 0, wcmConfig.panelCaseSensitive){	iL.AddWin(&showHiddenButton,	0, 0); showHiddenButton.Enable(); showHiddenButton.SetFocus(); showHiddenButton.Show(); 	iL.AddWin(&showIconsButton,	1, 0); showIconsButton.Enable(); showIconsButton.Show(); 	iL.AddWin(&caseSensitive,	2, 0); caseSensitive.Enable(); caseSensitive.Show(); 	AddLayout(&iL);	SetEnterCmd(CMD_OK);	showHiddenButton.SetFocus();		order.append(&showHiddenButton);	order.append(&showIconsButton);	order.append(&caseSensitive);	SetPosition();}
开发者ID:Karamax,项目名称:WalCommander,代码行数:20,


示例17: utf8_length

/* Calculates how much of string can be shown within the given maximum width * and sets trimmed parameter to non-zero value if all of string could not be * shown. If the reserve flag is true, it will reserve at least one * trailing character, which can be useful when drawing a delimiter. * * Returns the number of bytes to output from string to satisfy max_width. */size_tutf8_length(const char **start, int max_chars, size_t skip, int *width, size_t max_width, int *trimmed, bool reserve, int tab_size){	const char *string = *start;	const char *end = max_chars < 0 ? strchr(string, '/0') : string + max_chars;	unsigned char last_bytes = 0;	size_t last_ucwidth = 0;	*width = 0;	*trimmed = 0;	while (string < end) {		unsigned char bytes = utf8_char_length(string);		size_t ucwidth;		unsigned long unicode;		if (string + bytes > end)			break;		/* Change representation to figure out whether		 * it is a single- or double-width character. */		unicode = utf8_to_unicode(string, bytes);		/* FIXME: Graceful handling of invalid Unicode character. */		if (!unicode)			break;		ucwidth = unicode_width(unicode, tab_size);		if (skip > 0) {			skip -= ucwidth <= skip ? ucwidth : skip;			*start += bytes;		}		*width  += ucwidth;		if (max_width > 0 && *width > max_width) {			*trimmed = 1;			*width -= ucwidth;			if (reserve && *width == max_width) {				string -= last_bytes;				*width -= last_ucwidth;			}			break;		}		string  += bytes;		if (ucwidth) {			last_bytes = bytes;			last_ucwidth = ucwidth;		} else {			last_bytes += bytes;		}	}	return string - *start;}
开发者ID:phschoen,项目名称:tig,代码行数:60,


示例18: GoToDialog

	GoToDialog( int nId, NCDialogParent* parent )		:  NCVertDialog( ::createDialogAsChild, nId, parent, utf8_to_unicode( "Go to line" ).data(), bListOkCancel ), //0xD8E9EC, 0),		   edit( 0, ( Win* )this, 0, 0 )	{		edit.Enable();		edit.Show();		AddWin( &edit );		order.append( &edit );		edit.SetFocus();		SetPosition();	}
开发者ID:FaionWeb,项目名称:WCMCommander,代码行数:11,


示例19: CopyDialog

	CopyDialog( NCDialogParent* parent, bool move = false )		:  SimpleCFThreadWin( parent, move ? _LT( "Move" ) : _LT( "Copy" ) ),		   _layout( 7, 2 ),		   _text1( 0, this, utf8_to_unicode( move ? _LT( "Moving the file" ) : _LT( "Copying the file" ) ).data() ),		   _text2( 0, this, utf8_to_unicode( _LT( "to" ) ).data() ),		   _text3( 0, this, utf8_to_unicode( _LT( "Files processed" ) ).data() ),		   _from( this ),		   _to( this ),		   _countWin( this ),		   _progressWin( this ),		   _speedStr( uiValue, this, 0, 0, StaticLine::LEFT, 10 ),		   _lastMs( GetTickMiliseconds() )	{		_layout.AddWin( &_text1, 0, 0, 0, 1 );		_layout.AddWin( &_from, 1, 0, 1, 1 );		_layout.AddWin( &_text2, 2, 0, 2, 1 );		_layout.AddWin( &_to, 3, 0, 3, 1 );		_layout.AddWin( &_progressWin, 4, 0, 4, 1 );		_layout.AddWin( &_text3, 5, 0 );		_layout.AddWin( &_countWin, 5, 1 );		_layout.AddWin( &_speedStr, 6, 0 );		_text1.Show();		_text1.Enable();		_text2.Show();		_text2.Enable();		_text3.Show();		_text3.Enable();		_from.Show();		_from.Enable();		_to.Show();		_to.Enable();		_countWin.Show();		_countWin.Enable();		_progressWin.Show();		_progressWin.Enable();		_speedStr.Show();		_speedStr.Enable();		AddLayout( &_layout );		SetTimer( 1, 1000 );		SetPosition();	}
开发者ID:FaionWeb,项目名称:WCMCommander,代码行数:41,


示例20: stupid_set_current_work_directory

bool stupid_set_current_work_directory(const std::string & dirname){#ifdef _MSC_VER    std::string platform_dirname(dirname);    stupid_directory_format(platform_dirname);    return(0 == _wchdir(utf8_to_unicode(platform_dirname).c_str()));#else    std::string platform_dirname(dirname);    stupid_directory_format(platform_dirname);    return(0 == chdir(utf8_to_ansi(platform_dirname).c_str()));#endif // _MSC_VER}
开发者ID:yanrk,项目名称:stupid,代码行数:12,


示例21: RunDldMenu

int RunDldMenu( int nUi, NCDialogParent* parent, const char* header, clMenuData* data ){	if ( !data || data->Count() <= 0 ) { return CMD_CANCEL; }	NCDialog dlg( true, nUi, parent, utf8_to_unicode( header ).data(), 0 ); //, ::g_WcmConfig.whiteStyle ? 0xD8E9EC : 0xB0B000, 0xFFFFFF);	clSelectDriveDlgMenu mtable( &dlg, data );	mtable.Show();	mtable.Enable();	mtable.SetFocus();	dlg.AddWin( &mtable );	int Result = dlg.DoModal();	return Result;}
开发者ID:FaionWeb,项目名称:WCMCommander,代码行数:13,


示例22: clCreateDirDialog

	clCreateDirDialog( NCDialogParent* Parent, bool IsMultipleFolders, const unicode_t* Str )		: clInputStrDialogBase( Parent, utf8_to_unicode( _LT( "Create new directory" ) ).data() )		, m_Layout( 2, 9 )		, m_FieldEdit( EDIT_FIELD_MAKE_FOLDER, 0, (Win*)this, 0, 100, 7 )		, m_MultipleButton( 1, this, utf8_to_unicode( _LT( "Process multiple folders" ) ).data(), 0, IsMultipleFolders )	{		m_Layout.AddWinAndEnable( &m_FieldEdit, 0, 0, 0, 2 );		order.append( &m_FieldEdit );				m_Layout.AddWinAndEnable( &m_MultipleButton, 1, 0, 1, 2 );		order.append( &m_MultipleButton );				AddLayout( &m_Layout );				if ( Str )		{			m_FieldEdit.SetText( Str, true );		}				m_FieldEdit.SetFocus();		SetPosition();	}
开发者ID:FaionWeb,项目名称:WCMCommander,代码行数:22,


示例23: CfgLangDialog

	CfgLangDialog(NCDialogParent *parent, char *id, ccollect<LangListNode> *nl)	:	NCDialog(createDialogAsChild, 0, parent, utf8_to_unicode( _LT("Language") ).ptr(), bListOkCancel), 		_selected(0),		_list(Win::WT_CHILD,Win::WH_TABFOCUS|WH_CLICKFOCUS, 0, this, VListWin::SINGLE_SELECT, VListWin::BORDER_3D, 0),		nodeList(nl)			{ 		_list.Append( utf8_to_unicode( _LT("Autodetect") ).ptr()); //0		_list.Append( utf8_to_unicode( _LT("English") ).ptr()); //1				for (int i = 0; i<nl->count(); i++)			_list.Append( utf8_to_unicode(nl->get(i).name.ptr()).ptr() );					int cur = 0;		if (id[0] == '+') cur = 0;		else if (id[0] == '-') cur = 1;		else {			for (int i = 0; i<nl->count(); i++)				if (!strcmp(id, nl->get(i).id.ptr()))				{					cur = i+2;					break;				}		}		_list.MoveCurrent(cur);				_list.Enable();		_list.Show();		_list.SetFocus();		LSRange h(10, 1000, 10);		LSRange w(50, 1000, 30);		_list.SetHeightRange(h); //in characters		_list.SetWidthRange(w); //in characters				AddWin(&_list);		SetEnterCmd(CMD_OK);		SetPosition();	};
开发者ID:Karamax,项目名称:WalCommander,代码行数:38,


示例24: main

int main(int argc, char *argv[]){   // check arguments    if (argc < 3)    {        // print out help topic        std::cout << std::endl;        std::cout << std::endl;        std::cout << "-------------------------------------------------------------------------------" << std::endl;        std::cout << "/t/tDoc/Docx file converter. Version: " << STRVER  << std::endl;        std::cout << "-------------------------------------------------------------------------------" << std::endl;        std::cout << std::endl;        std::cout << "USAGE: ASCDocConverter /"path_to_file_1/" /"path_to_file_2/" " << std::endl;        std::cout << "WHERE:" << std::endl;        std::cout << "/t/"path_to_file_1/" is a path to file to be converted" << std::endl;        std::cout << "/t/"path_to_file_2/" is a path to the corresponding output file" << std::endl << std::endl;       return 1;    }    CString sArg1, sArg2, sExePath;    sExePath    = utf8_to_unicode(argv [0]);    sArg1       = utf8_to_unicode(argv [1]);    sArg2       = utf8_to_unicode(argv [2]);    CString sXMLOptions = _T("");    {// doc->docx        COfficeDocFile docFile;        HRESULT hRes = docFile.LoadFromFile(sArg1, sArg2, sXMLOptions);        if (hRes != S_OK)return 2;    }    return 0;}
开发者ID:alexandervnuchkov,项目名称:core,代码行数:38,


示例25: Node

void ToolBar::AddCmd( int cmd, const char* tipText ){	if ( cmd != 0 )	{		clPtr<Node> p = new Node();		p->cmd = cmd;		if ( tipText && tipText[0] ) { p->tipText = utf8_to_unicode( tipText ); }		p->icon = new cicon( cmd, _iconSize, _iconSize );		_list.push_back( p );		RecalcItems();	}}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:14,


示例26: ScanedDirString

static std::vector<unicode_t> ScanedDirString( const unicode_t* dirName ){	ccollect<unicode_t, 100> list;	if ( dirName )	{		for ( int i = 0; i < 100 && *dirName; dirName++, i++ )		{			list.append( *dirName );		}		if ( *dirName )		{			list.append( ' ' );			list.append( '.' );			list.append( '.' );			list.append( '.' );		}	}	list.append( 0 );	return carray_cat<unicode_t>( utf8_to_unicode( _LT( "Folder:" ) ).data(), utf8_to_unicode( " /"" ).data(), list.ptr(), utf8_to_unicode( "/"" ).data() );}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:23,


示例27: new_pos

voidnew_pos(struct form_state *fs, struct line_info *line, int current, int max_cells){	unsigned char *text = fs->value + line[current].start;	unsigned char *end = fs->value + line[current].end;	int cells = 0;	while(cells < max_cells) {		unicode_val_T data = utf8_to_unicode(&text, end);		if (data == UCS_NO_CHAR) break;		cells += unicode_to_cell(data);	}	fs->state = (int)(text - fs->value);}
开发者ID:Efreak,项目名称:elinks,代码行数:15,



注:本文中的utf8_to_unicode函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ utf8_width函数代码示例
C++ utf8_strlen函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。