• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit Search
0

How to decode A_char array into Chinese string using plugin SDK?

Explorer ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

shell22398911sc0d_1-1647171249301.png

The name of the project is 测试.aep in Chinese, How can I convert proj_nameAC to Chinese string?

TOPICS
SDK

Views

232

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

perhpas AEGP_GetProjectPath which returns a utf16 string?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 13, 2022 Mar 13, 2022

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 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

thanks for your help, how to convert multybyte to wide char on mac?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines