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

Importing UTF-8 Text

Community Expert ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

I am using doc.Import to import a text file into FrameMaker. The text file is encoded in UTF-8. Is there a UTF-8 Constant for importing text files in FrameMaker? Here is my function:

TTC_MB.importFile = function (filename, textLoc, doc) {
    
    var importProps, retProps, i;
    
    // Get default property list for importing documents.
    importProps = GetImportDefaultParams ();
    // Get a property list to return any error messages.
    retProps = new PropVals ();

    // Set specific import property values to import the document.
    i = GetPropIndex (importProps, Constants.FS_AlertUserAboutFailure);
    importProps[i].propVal.ival = false;
    i = GetPropIndex (importProps, Constants.FS_HowToImport);
    importProps[i].propVal.ival = Constants.FV_DoByCopy;

    // Attempt to import the document.
    doc.Import (textLoc, filename, importProps, retProps);
};

 

TOPICS
Scripting

Views

136

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
Community Expert ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

Knowing nothing about this, is doc.Import an FM FDK API?

If it's an analog of the File > Import command, I'd expect it to have options for Copy-In v. By-Reference, and some vague spec for object type.

And on that, I note that the command, for Text, only specifies "Text", and does not resolve to codeset.

UTF-8 BMP v. SMP would of course also potentially arise.

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
Community Expert ,
Nov 20, 2020 Nov 20, 2020

Copy link to clipboard

Copied

LATEST

Hi Bob, Yes, but when you choose Text in the interface and go to the next dialog, you can specify the encoding. There are FDK/ExtendScript import settings for all of the entries except the UTF entries.

 

frameexpert_0-1605888195020.png

 

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