本人自己创作和测试的。
path是原来的目录
////////////////////////////////////////////////////////////////////////
////////////////////以下是解决了中文目录的问题
int a=::MultiByteToWideChar(CP_ACP,NULL,path,strlen(path),NULL,0);
// 分配空间要给'/0'留个空间,MultiByteToWideChar不会给'/0'空间
wchar_t * wszString=new wchar_t[a+1];
::MultiByteToWideChar(CP_ACP,NULL,path,strlen(path),wszString,a);
wszString[a]='/0';
int u8Len=::WideCharToMultiByte(CP_UTF8,NULL,wszString,wcslen(wszString),NULL,0,NULL,NULL);
char* path1= new char[u8Len+1];
::WideCharToMultiByte(CP_UTF8,NULL,wszString,wcslen(wszString),path1,u8Len,NULL,NULL);
path1[u8Len]='/0';
for (int i=0;i<100;i++)
{
path[i]=path1[i];
}
///////////////////////////////////////////////////////////////////////////
最后path的路径得到了更新,这样中文的路径和中文的文件名都可以播放了