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

How covert AIUnicodeString to ADMUnicode ?

New Here ,
Jun 25, 2008 Jun 25, 2008

Copy link to clipboard

Copied

how covert AIUnicodeString to ADMUnicode or covert ADMUnicode to AIUnicodeString??

I want to show file path on ADMItem, but the file path is AIUnicodeString, and SetTextW function need ADMUnicode, how can I do it?

Thanks!

hanyang.
TOPICS
SDK

Views

1.0K

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
Adobe
Guide ,
Jun 25, 2008 Jun 25, 2008

Copy link to clipboard

Copied

I assume you mean ai::UnicodeString, not AIUnicodeString -- the name of the header in which the former is found. I'll proceed on that assumption.<br /><br />The method you want is ai::UnicodeString::as_ASUnicode(). This will give you a basic_string<ASUnicode> as a result. You should be able to use this to get a ASUnicode* result using c_str(). <br /><br />The important thing to note is that ASUnicode & ADMUnicode are the same type; one is a typedef of the other.<br /><br />I'd provide code but we actually use a third party library that handles our strings, so I actually convert from ai::UnicodeString to our third party string, and from that to ADMUnicode when the time comes. It's not hard though, once you have the result of as_ASUnicode().

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
New Here ,
Jun 26, 2008 Jun 26, 2008

Copy link to clipboard

Copied

Thanks A. Patterson!

I want to my plugin support Asia language, but Asia character can't correctly display on ADMItem by using ADMUnicode, and now I don't know what the problem is.

Here's the code:

sAAIUser->GetDirectoryDialog( title, forceLocalFileView, Directory_Path );

if ( !Directory_Path.IsEmpty() )
{
const ADMUnicode* DisplayFilePath = Directory_Path.GetFullPath().as_ASUnicode().c_str();
sADMItem->SetTextW(sADMDialog->GetItem(dialog, kDestinationPath), DisplayFilePath );
}

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
New Here ,
Oct 18, 2011 Oct 18, 2011

Copy link to clipboard

Copied

LATEST

I was happy to find this bit of advice, but I am still having trouble with ADMUnicode, especially on Mac.

On Windows, I ran into the issue where a string that was not using unicode characters would result in an empty ADMUnicode string.

Now on Mac, the strings are not empty when I step through code, but there is no text displayed in my dialogs when I use SetTextW. It will sometimes show up after I set a breakpoint in XCode and return to AI, but the next update will clear it.

Any ideas about what is going on here? The functions work in Windows as long as I make sure the string is not empty.

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