How to decode A_char array into Chinese string using plugin SDK?
Copy link to clipboard
Copied
The name of the project is 测试.aep in Chinese, How can I convert proj_nameAC to Chinese string?
Copy link to clipboard
Copied
perhpas AEGP_GetProjectPath which returns a utf16 string?
Copy link to clipboard
Copied
In this way, it can be converted into Chinese, but this way uses python
https://stackoverflow.com/questions/2190904/how-to-correct-the-misencoded-string
Copy link to clipboard
Copied
it's a multibyte string. it can be handled via c/c++.
https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar
Copy link to clipboard
Copied
thanks for your help, how to convert multybyte to wide char on mac?
Copy link to clipboard
Copied
int code_convert(char *from_charset,char *to_charset,char *inbuf,int inlen,char *outbuf,int outlen)
{
iconv_t cd;
int rc;
char **pin = &inbuf;
char **pout = &outbuf;
cd = iconv_open(to_charset,from_charset);
if (cd==0) return -1;
memset(outbuf,'\0',outlen);
if (iconv(cd,pin,(size_t *)&inlen,pout,(size_t*)&outlen)==-1) return -1;
iconv_close(cd);
return 0;
}
char gb2312Char[255] = "";
code_convert("gb2312","utf-8",proj_nameAC,strlen(proj_nameAC),gb2312Char,255);
this code works for me,thank you again for your help.

