Unicode in Find and Reo

Community Beginner ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

When I want to use the Unicodes in Find/Change, only the number is written, not the character.

How can I solve it?

Screenshot 2021-12-06 170418.png

 

TOPICS
How to , Scripting

Views

190

Likes

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 Beginner ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

Unicode in Find/Change

Likes

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
LEGEND ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

Don't type <202C>. Paste the correct Unicode character.

Likes

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
Adobe Community Professional ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

Try writing it as <0202C>

-Manan

Likes

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
Adobe Community Professional ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

No -- the OP's original <202C> in the replace-text field is correct.

Likes

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
Adobe Community Professional ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

Well then what could be the reason for this behaviour that OP sees. I mean sure the literal would work but why does this unicode annotation not work?

-Manan

Likes

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
Adobe Community Professional ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

Should this be done as GREP rahter than Plain Text?

Likes

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
Adobe Community Professional ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

The OP seems to be looking for literals, so plain text will do fine.

Likes

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
Adobe Community Professional ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

I just tried it here on Win 10 in version 16.4 (US English) and it seems to work correctly as Alireza Nikzad has it entered in the image so I suspect there is something specific about his install.

Likes

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
Guide ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

Hi @Alireza Nikzad 

 

A quick script can change the <hhhh> code (once entered in the Change to field) into the corresponding character:

 

(function(p,t)
{
   (t=p.properties.changeTo)
   && /^<[0-9a-f]{1,6}>$/i.test(t)
   && 0xFFFF >= (t=Number('0x'+t.slice(1,-1)))
   && (p.changeTo=String.fromCharCode(t));
})(app.changeTextPreferences);

 

Note 1. — Code points beyond the BMP aren't converted, although available in principle. Surrogate pairs don't seem to be rendered in that field—InDesign reverts to the <HHHHH> syntax—so I've removed the support of U+10000..U+10FFFF from my original code.

 

Note 2. — It would be interesting to make this script responsive, but I'm not sure it's possible.

 

Best,

Marc

Likes

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
Adobe Community Professional ,
Dec 07, 2021 Dec 07, 2021

Copy link to clipboard

Copied

Hi Alireza,

try this:

 

TEXT Find what: pattern

<200C>

TEXT Change to: pattern

<202C>

 

I tried this with this sample text where three instances of a Zero Width Nonjoiner were inserted by using my German InDesign version 17.0.1.105. Scope was the selected story:

 

Replace-Unicode-with-Unicode-TEXT.PNG

 

The result was this:

Replace-Unicode-with-Unicode-TEXT-Result.PNG

 

Don't know if you expect this…

 

TEXT Pattern

^j

should find a Zero Width Nonjoiner special character.

 

Scroll down to section Metacharacters for searching:

https://helpx.adobe.com/indesign/using/find-change.html

 

Regards,
Uwe Laubender

( ACP )

Likes

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 Beginner ,
Dec 07, 2021 Dec 07, 2021

Copy link to clipboard

Copied

Hi @Laubender

I want to use this unicode character to fix the previous problem with running headers:

Re: non-joiner character (Unicode <200C>) didn't w... - Adobe Support Community - 12568129

and it worked:

Screenshot 2021-12-08 084522.png

And I can use this Find/Change myself, but when I suggested this solution to my friends, some of them told me they can't use unicodes in Find/Change. Now I want to find a final solution to help them.

Likes

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
Adobe Community Professional ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

LATEST

Hi Alireza,

interesting!

Could you share sample documents with that text variable?

One before you did the find/change and one with the result.

 

Thanks,
Uwe Laubender

( ACP )

Likes

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