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, 2020 in Java by anonymous
• 140 points
1,797 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
• 59,230 points
2,211 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,920 points
1,856 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
• 59,230 points
3,010 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,140 points
31,366 views
0 votes
0 answers

How do I copy to the clipboard in JavaScript?

How can I copy text to the ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
777 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,890 points
684 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,890 points
1,470 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,140 points
734 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP