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

AEGP_AddCompToRenderQueue doesn't accept unicode paths

New Here ,
Jan 03, 2019 Jan 03, 2019

Hi,

I'm using the AEGP_AddCompToRenderQueue API to add a composition to the render queue.

Here's its signature:

SPAPI A_Err (*AEGP_AddCompToRenderQueue)(

                                        AEGP_CompH comp, /* >> */

                                        const A_char* pathZ);

A problem occurs when my paths contain unicode characters. I'm holding everything as wstrings, but then I convert to utf8

before passing them into the API, since it calls for A_char. Unfortunately, it seems like it doesn't like utf8; for example,

passing the filename string

testš.mp4

causes the render queue to save a file as

testš.mp4

How to solve this?

I'm working on Windows.

Thanks in advance.

353
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
LEGEND ,
Jan 03, 2019 Jan 03, 2019

Change your file path folder names to common letters & numbers.  Same thing for file names.

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
New Here ,
Jan 04, 2019 Jan 04, 2019

I totally would, but our plugin could be running on the machine of a customer whose name

(and therefore home directory contains unicode characters, like e.g. c:\users\šomename), and so any path their AE instance has permissions to write to already contains the problematic characters.

I've played around with the idea of converting to the old school DOS-mode directory names, but this has to work on Mac as well eventually, and so I'm not confident that'll work in the long run.

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
New Here ,
Jan 22, 2019 Jan 22, 2019
LATEST

So, I'll share what I did.

On Windows, the path to the temporary folder (where the file to render will end up) might contain unicode characters, as mentioned above. I decided to go ahead with DOS "8.3 aliases." The catch is that these only work for files/folders that already exist; since I'm referring to a file that I'm about to render, the file doesn't exist yet. But the directory does. So I convert the directory with the win32 PathGetShortName API. On Mac, the temp directory is not a problem.

For the filename itself, I just create a new filename substituting unicode characters (i.e. !isascii( )) with their integer representation, so "helloç" becomes "hello231".

Concatenate the two above, and you have a fully ascii, cross-platform solution to the problem.

Only caveat is that some systems disable 8.3 aliases, so in this case the Windows solution won't work in every case.

Hope this helps someone...

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