Skip to main content
Inspiring
July 21, 2011
Question

CS3/CS4/CS5 Win/Mac: How can I convert a Windows string to mac?

  • July 21, 2011
  • 1 reply
  • 863 views

Hi

I have a Windows coded string. I like to convert this string into a Macintosh string. This means several characters are changed, e.g. ä, ö or ü.

Is there a method in the Indesign SDK?

How can I convert a windows string into a macintosh string and back?

Thanks

Hans

This topic has been closed for replies.

1 reply

Jongware
Community Expert
Community Expert
July 21, 2011

Shouldn't this problem fix itself when you convert it to a PMString?

hstoesselAuthor
Inspiring
July 21, 2011

Hi

I solved it...

I should have a Windows string in the Mac version of my plugin. I converted a Unicode string into a platform string (Mac) and then into a Windows string. This doesn't work!

Now I convert the Unicode string (Widestring) directly into a Windows string via Apple methods. This works correct.

Thanks

Hans

Inspiring
July 21, 2011

I don't think this should work that way. If this string is in resource file, use UTF-8 encoding and make PMString do its job. use kResourceUTF8Encoded in StringTable:

resource StringTable (kSDKDefStringsResourceID + index_enUS)
{
        k_enUS,                                             // Locale Id
        kResourceUTF8Encoded,                         // Character encoding converter (irp) I made this WinToMac as we have a bias to generate on Win...
        {
              // ----- Menu strings
                kWFPCompanyKey,                         kWFPCompanyValue,
                kWFPAboutMenuKey,                         kWFPPluginName "[US]...",
                kWFPPluginsMenuKey,                    kWFPPluginName "[US]",
                    kWFPDialogMenuItemKey,               "Show dialog[US]",
     
                kSDKDefAboutThisPlugInMenuKey,               kSDKDefAboutThisPlugInMenuValue_enUS,

                // ----- Command strings

                // ----- Window strings

                // ----- Panel/dialog strings
                    kWFPDialogTitleKey,     kWFPPluginName "[US]",
                    
                    kWFP_Tuna_Key,     "Tuna",
                    kWFP_Salmon_Key,     "Salmon",
                    kWFP_Bonito_Key,     "Bonito",
                    kWFP_Yellowtail_Key, "Yellowtail",
                    kWFP_Currency_Key, "$",


          // ----- Misc strings
                kWFPAboutBoxStringKey,               kWFPPluginName " [US], version " kWFPVersion " by " kWFPAuthor "\n\n" kSDKDefCopyrightStandardValue "\n\n" kSDKDefPartnersStandardValue_enUS,

          
        }

};

Message was edited by: Maciej Przepióra