Skip navigation
Currently Being Moderated

List of Invalid index Entries

Aug 7, 2012 3:53 AM

Tags: #index #invalid_index_entries #index_entries #invalid_characters

I have imported MS Word documents with index entries (Cyrillic and Latin alphabetet, quotation marks etc. ).

 

Now I want to generate index and I have the alert:

 

"The index could not be generated.

One or more index entries contain invalid characters.

Please delete any invalid characters from the index entries".

 

Where I can find the complete list of characters which Adobe defines as invalid?

 

Don't you think that Preflight should check and mark such characters?

 
Replies
  • Currently Being Moderated
    Aug 7, 2012 4:34 AM   in reply to Olfar

    Olfarr wrote:

     

    I have imported MS Word documents with index entries (Cyrillic and Latin alphabetet, quotation marks etc. ).

     

    Now I want to generate index and I have the alert:

     

    "The index could not be generated.

    One or more index entries contain invalid characters.

    Please delete any invalid characters from the index entries".

     

    Either Word or InDesign sometimes add a null character at the end of an index entry. Yup, "sometimes". Not "always", not "never". A null character is invalid in almost every text string.

     

    If this is the only problem, you can remove them with this short Javascript:

     

    indexTopics = app.activeDocument.indexes[0].topics;
    for (i=0; i<indexTopics.length; i++)
    indexTopics[i].name = indexTopics[i].name.replace(String.fromCharCode(0), '');
    

     

    -- the way to check if this is the only problem is to run it, then try to regenerate your index

    The script does not check for sub-topics; if you have these and it still doesn't work, the script needs expanding.

     

    Internally, strings inside InDesign are coded as Unicode. null (U+0000) is an invalid character in most contexts, but so are others such as U+FFFE (not-a-character), U+1FFF (not an existing Unicode), and U+D801 (only half of a 2-code combined Unicode). But it depends on context as well: something like a Hard Return is legal inside text but (surely?) illegal inside an index entry.

     

    Don't you think that Preflight should check and mark such characters?

     

    I'd rather have InDesign not import invalid characters to begin with!

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2012 7:57 AM   in reply to Olfar

    Well, if you know the value of your invalid characters, you can use my script to remove them from your InDesign index!

     

    Replace the 'replace' line with this:

     

      indexTopics[i].name = indexTopics[i].name.replace('\u001F\u001E, '-');

     

    so both of these characters will be removed and replaced with a regular hyphen.

     

    "AID somethin' somethin'" must be some IDML code to insert special characters as plain text; the "001f" part is what we're interested in. (I checked the same way, only I tested for a null character.)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points