2 Replies Latest reply: Jan 13, 2011 6:34 AM by starnight1981 RSS

    About ai::FilePath  in MacOS

    starnight1981 Community Member

      I want to read  the current document binary data In MacOS X,this is my code:

       

      ai::FilePath file;

      sAIDocument->GetDocumentFileSpecification(file);

      std::string localFilePahtName = file.GetFullPath().as_Platform();

      std::ifstream files( localFilePahtName.c_str(),std::ios_base::binary|std::ios_base::in);

      if (files.is_open()==false ) return -1;

      else

      {

          // do something

      }

      ......

       

      If the file name contains only Latin ,like    "\abc\file.ai "  ,there is no problem,

      but If the file name contains Chinese,like "\abc\你好.ai",

          files.is_open() == false,

      and  return -1;

       

       

      This only occurs in mac platform,In Windows, would not have this happen。

       

      Who can help me, where is the problem?