Copy link to clipboard
Copied
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?
Manan, Peter,
thank you for taking the time to look at this.
Peter, to your questions:
Manan, seeing that it worked for you, I tried it to with a new, clean document. This did not work. But t
...Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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}
Copy link to clipboard
Copied
Manan, Peter,
thank you for taking the time to look at this.
Peter, to your questions:
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!
Copy link to clipboard
Copied
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.