Skip to main content
Inspiring
March 6, 2019
Answered

Is built-in Find/Change by list script Unicode compliant?

  • March 6, 2019
  • 2 replies
  • 2198 views

I'm using the built-in find/change by list script for a scholarly text. It works fine, but some search and replace queries that involve some more unusual characters are turned into gibberish.

So I'm wondering if anybody knows whether the script is actually fully Unicode compliant, or if there is something that I'm doing wrong.

The query I've been using is below (the academic author uses a hacked pi font to get special ornaments instead of the correctly encoded unicode characters, hence the substitution):

grep    {findWhat:"(?<=\\s)r(?=\\s)"}    {changeTo:"ﷺ"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find r between any whitespaces and replace with ﷺ.

grep    {findWhat:"(?<=\\s)u(?=\\s)"}    {changeTo:"ﷷ"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find u between any whitespaces and replace with ﷷ.

But when I run it, the outcome in InDesign is Ô∑∑ instead of ﷷ and Ô∑∫ instead of ﷺ . Any clues?

This topic has been closed for replies.
Correct answer tntype

Manan, Peter,

thank you for taking the time to look at this.

Peter, to your questions:

  • it worked manually and when I did a manual search, copy-pasting the very same characters into the search dialogue
  • I tried the Unicode values using the <XXXX> as I would in the search dialogue, which of course didn't work. I wasn't aware of the syntax that you've given me, thank you! Where else could I find this?

Manan, seeing that it worked for you, I tried it to with a new, clean document. This did not work. But then I moved the two queries that I've shared here to the top of the query list, and all of a sudden it worked. I've double checked by putting it below again, and then I had the same garbled text again.

This made me check the preceding GREP queries again, and I realised that I had not double escaped a number of queries, which in combination must have caused the replacements to go weird. I've checked and corrected everything and now it all works, no matter the order of queries.

Thank you both again!

2 replies

Adobe Expert
March 7, 2019

InDesign is Unicode-compliant, the script should be, too. What you see is strange behaviour.

Do you get the correct result when you insert the character and apply the font manually?

What happens when you do the find/change manually?

If the above don't work, maybe use the character's Unicode value instead of the character literal. To get a character'sUnicode value, enter it in a text frame, select it, and open the Info panel. It's displayed as e.g. 0xFDFA. In the GREP replacement, use the format \x{FDFA}

tntypeAuthorCorrect answer
Inspiring
March 7, 2019

Manan, Peter,

thank you for taking the time to look at this.

Peter, to your questions:

  • it worked manually and when I did a manual search, copy-pasting the very same characters into the search dialogue
  • I tried the Unicode values using the <XXXX> as I would in the search dialogue, which of course didn't work. I wasn't aware of the syntax that you've given me, thank you! Where else could I find this?

Manan, seeing that it worked for you, I tried it to with a new, clean document. This did not work. But then I moved the two queries that I've shared here to the top of the query list, and all of a sudden it worked. I've double checked by putting it below again, and then I had the same garbled text again.

This made me check the preceding GREP queries again, and I realised that I had not double escaped a number of queries, which in combination must have caused the replacements to go weird. I've checked and corrected everything and now it all works, no matter the order of queries.

Thank you both again!

Known Participant
June 19, 2022

I have got the same problem as you have. I can do the replace action by writing their Unicodes, but not the words themselves. You wrote that you paste those two queries and they started working suddenly. Could you please tell me how did you do that? I have tried several times, but nothing changed. It would be great if you could share with me your file that is working properly.

Adobe Expert
March 7, 2019

Works fine for me, the only guess i can make is that the encoding of the FindChangeList.txt is not correct at your end. Try to set it to UTF8 and then try. Have a look at the results i am getting and verify if the character is rendered correctly, maybe i am making wrong assumptions due to my  untrained eyes.

P.S. :- I am using the default paragraph composer of InDesign

-Manan