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

About ai::FilePath in MacOS

Guest
Jan 10, 2011 Jan 10, 2011

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?

TOPICS
SDK
872
Translate
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

correct answers 1 Correct answer

Guide , Jan 10, 2011 Jan 10, 2011

I believe the problem is you want as_UTF8() not as_Platform(). I'm 99% sure that MacOS uses UTF8 for all their file path stuff, and as_Platform() will be in the local encoding, not UTF8. Place to start at any rate

Translate
Adobe
Guide ,
Jan 10, 2011 Jan 10, 2011

I believe the problem is you want as_UTF8() not as_Platform(). I'm 99% sure that MacOS uses UTF8 for all their file path stuff, and as_Platform() will be in the local encoding, not UTF8. Place to start at any rate

Translate
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
Guest
Jan 13, 2011 Jan 13, 2011
LATEST

A. Patterson ,thank you.

Translate
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