Menu

#508 zh_CN locale problem

open-fixed
nobody
None
5
2010-08-26
2010-08-19
liang boll
No

my mediainfo cli compiled with unicode, some mp3 file has gb2312 info, if export LC_ALL=zh_CN.UTF-8, get no Performer info, but if export LC_ALL=zh_CN, get info about this file, what\'s wrong? how to resolve it?

Discussion

  • liang boll

    liang boll - 2010-08-26

    i find some bug in Zlib, Ztring::To_Local();
    size_t Size=mbstowcs(NULL, S, 0);
    if (Size!=0 && Size!=(size_t)-1)
    {
    wchar_t* WideString=new wchar_t[Size+1];
    Size=mbstowcs(WideString, S, Size);
    WideString[Size]=L'\0';
    assign (WideString);
    delete[] WideString; //WideString=NULL;
    } else
    clear();

    change clear() to do something, like setlocale() and convert again, i resolve it.

     
  • liang boll

    liang boll - 2010-08-26
    • status: open --> open-fixed
     

Log in to post a comment.