Skip to main content
frameexpert
Community Expert
Community Expert
Nov 19, 2020 7:39 PM UTC
Question

Importing UTF-8 Text

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);
};

 

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Bob_Niland
Community Expert
Community Expert
Nov 19, 2020 11:25 PM UTC

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.

Translate
frameexpert
Community Expert
Community Expert
Nov 20, 2020 4:04 PM UTC

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.

 

 

Translate
www.frameexpert.com