简体   繁体   English

使用javascript在Acrobat Pro中搜索unicode代理

[英]Searching for unicode surrogates in Acrobat Pro using javascript

I wanted to search for Japanese text using the Acrobat Javascript API ( search.query ). 我想使用Acrobat Javascript API( search.query )搜索日文文本。 Everything works fine except for the code range 0xD800~0xDFFF (Unicode surrogate code points). 除了代码范围0xD800~0xDFFF(Unicode代理代码点)之外,一切正常。 I have tried copy and pasting the text I want to search for into my .js file and have also tried entering the surrogate code points, in either case they appear as a "." 我已经尝试将我要搜索的文本复制并粘贴到我的.js文件中,并且还尝试输入代理代码点,在任何一种情况下它们都显示为“。”。 in the search window. 在搜索窗口中。

Here are my questions: 这是我的问题:

  1. Why does the text appear as a dot in Acrobat? 为什么文本在Acrobat中显示为点?
  2. Is there any way to search for surrogates through Acrobat Javascript? 有没有办法通过Acrobat Javascript搜索代理?

Edit: More information: In Acrobat, hit "Ctrl+J" to launch the debugger and type 编辑:更多信息:在Acrobat中,单击“Ctrl + J”以启动调试器并键入

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

and hit "Ctrl+Enter". 然后按“Ctrl + Enter”。 You should see two dots (ie, ".." ) in the search window (at least with Acrobat 9). 您应该在搜索窗口中看到两个点(即".." )(至少使用Acrobat 9)。 The peculiar thing is that, if you type 特别的是,如果你输入

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

it displays the character (a box) that I want to search for. 它显示我想要搜索的字符(框)。

Have you tried entering correct pairs of surrogates? 你试过输入正确的代理人对吗? Stand-alone code units in the surrogate area don't make any sense, and can't be rendered. 代理区域中的独立代码单元没有任何意义,也无法呈现。 Nothing to with Acrobat. Acrobat没什么用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM