Finding Unicode surrogates in Acrobat Pro using javascript

I wanted to find Japanese text using the Acrobat Javascript ( search.query) API . Everything works fine, except for the code range 0xD800 ~ 0xDFFF (Unicode surrogate code points). I tried to copy and paste the text that I want to find into my .js file, and also tried to enter surrogate codes, in any case they are displayed as ".". in the search box.

Here are my questions:

  • Why is text displayed as a dot in Acrobat?
  • Is there a way to search for surrogates through Acrobat Javascript?

Edit: More info: In Acrobat, press "Ctrl + J" to start the debugger, and type

search.query("\uDBCE\uDE2F", "ActiveDoc"); 

and press "Ctrl + Enter". You should see two dots (i.e. "..") in the search box (at least with Acrobat 9). The tricky thing is if you type

app.alert("\uDBCE\uDE2F");

displays the character (field) I want to find.

+5
source share
1 answer

Have you tried to introduce the correct pairs of surrogates? Separate code blocks in the surrogate area make no sense and cannot be provided. It costs nothing with Acrobat.

0
source

All Articles