QUOTE(foosion @ Jun 22 2006, 03:51)

Correct, but not the most straightforward thing to do. You can use pfc::stringcvt::string_*_from_utf8, for example pfc::stringcvt::string_ansi_from_utf8. Also, is there a particular reason why you need ANSI instead of UTF-16?
I use pfc::stringcvt::string_ansi_from_utf8 but failured;
I want send strings from myplugs to another program,and those strings have some chinese,eg:"c:\\中文",but the progam receive strings are disorderly strings,my codes as follows:
//send message
pfc::string8 text;
......
pc->playback_format_title_ex(handle, NULL, text, formatobj, NULL, playback_control::display_level_all);
pfc::stringcvt::string_os_from_utf8 os_class_name(text);
HWND hWnd;
COPYDATASTRUCT Cds;
hWnd=FindWindow(NULL,_T("another progame"));
if(hWnd!=NULL)
{
memset(&Cds,0x00,sizeof(COPYDATASTRUCT));
Cds.dwData =CmdSongFileName;
Cds.cbData =os_class_name.length()+1;
Cds.lpData =(LPVOID)os_class_name.get_ptr();
SendMessage(hWnd,WM_COPYDATA,0,(LPARAM)&Cds);
}
//receive message
COPYDATASTRUCT * pcds = (COPYDATASTRUCT *)Message.CopyDataStruct;
switch(pcds->dwData)
{
case CmdSongFileName:
wchar_t *tt=new wchar_t[pcds->cbData];
CopyMemory(tt,pcds->lpData,pcds->cbData);
delete []tt;
break;
}
Finally variable "tt" result are disorderly strings!why?how to solve?