How can I assign unicode to a variable in JavaScript, but have the script then populate a PDF field not in the unicode, but in the Chinese characters the unicode represents?

+2 votes
Here is the code I am using.  The PDF software has no issues with the ENGLISH TEXT, it populates the field without problem.  When I insert Chinese characters where I have the place-holder UNICODE, the PDF software turns the Chinese into ????.  And this occurs immediately when I try to save the code. So I think the only solution (open to suggestions) is to convert the Chinese to unicode, and then have the script read the unicode but output the Chinese characters to the variable?  Hope someone can assist, thank you!

var EntityData = { Entity_Ltd :{ engaddy: "ENGLISH TEXT",
                              chiaddy: "UNICODE"},
                              Select_Entity :{ engaddy: "  ",
                              chiaddy: "  " }
                              };
function SetFieldValues(eName)
{
  this.getField("AddressEnglish").value = EntityData[eName].engaddy;
  this.getField("AddressChinese").value = EntityData[eName].chiaddy;
}
Jan 13 in Java by anonymous
• 140 points
551 views
Hey, could you please simplify your query, or may be fragment it. I am unable to comprehend the issue you are facing.

What PDF software are you talking about buddy?
I am using Nitro, I need this to work in Adobe also.

I have a drop-down menu containing the variables.  When a variable is selected, two text boxes are populated with the values assigned within the code.  One of the boxes is populated with English.  One is populated with Chinese characters.  

I have now succeeded in making this work in Nitro by assigning to the variable (in the code)  UTF-16, rather than the actual Chinese characters.  

Adobe, however, still shows up as ???.  Is there a line of code I can add so that Adobe will know that some of the variable values are UTF-16 that  should be converted to Chinese characters?

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Java

0 votes
2 answers

How can I convert a String variable to a primitive int in Java

 Here are two ways illustrating this: Integer x ...READ MORE

answered Aug 20, 2019 in Java by Sirajul
• 58,130 points
533 views
0 votes
2 answers

How can I get the filenames of all files in a folder which may or may not contain duplicates

List<String> results = new ArrayList<String>(); File[] files = ...READ MORE

answered Sep 12, 2018 in Java by Sushmita
• 6,890 points
775 views
0 votes
2 answers

How can I invoke a method when the method name is in the form of a given string?

You could probably use method invocation from reflection: Class<?> ...READ MORE

answered Aug 19, 2019 in Java by Sirajul
• 58,130 points
288 views
0 votes
1 answer

How can I solve this: To prevent a memory leak, the JDBC Driver has been forcibly unregistered

What can you do? Ignore these warnings. Tomcat ...READ MORE

answered Jan 8, 2019 in Java by Daisy
• 8,110 points
13,516 views
0 votes
3 answers

How to check whether a file exists or not in Java?

Using nio we can check whether file ...READ MORE

answered Aug 14, 2018 in Java by Sushmita
• 6,890 points
1,301 views
0 votes
1 answer

Presenting docket dtates inside html page by javascript

Use the Docker Engine Api:Docker Engine API ...READ MORE

answered Jun 20, 2018 in Docker by DareDev
• 6,870 points
100 views
0 votes
1 answer

Migrating proxy npm repo in nexus 3

I don't think you can achieve this ...READ MORE

answered Jun 22, 2018 in DevOps Tools by DareDev
• 6,870 points
500 views
+1 vote
1 answer

What is the difference between JavaScript and Java

This quote rightly explains that 2 totally ...READ MORE

answered Jun 29, 2018 in Java by Daisy
• 8,110 points
123 views