Why does Ñ changes to special character?

Community Beginner ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

I have an array of data in which i was using to populate my dropdown. One of its data was "DASMARIÑAS" but when i press the drop down it shows as "DASMARIÑAS". I'll attach a photo bellow for reference, Thanks!

 

1. Here i typed in the data which i wanted to show in my dropdown in document javascript

1.png

 

2. Upon saving the document javascript i created this is what it shows for letter Ñ, it change to Ã‘

2.png

 

3. and lastly this is what it shows on my dropdown

Untitled.png

TOPICS
General troubleshooting, How to, JavaScript, PDF forms

Views

83

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

correct answers 1 Correct Answer

Adobe Community Professional , Feb 25, 2021 Feb 25, 2021
you can test between ANSI or UTF-8. According to their support notes, if you save to UTF-8, save without the byte order mark.

Likes

Translate

Translate
Adobe Community Professional ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

Hi,

 

Can you edit the JS in the in built editor and see if that has the same problem, I was able to have the value added via the UI and a script.

BarlaeDC_0-1614250835916.png

Malcolm

 

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 ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

the problem using acrobat editor is it doesnt open my script. my script consists of thouasands of lines that is why im using notepad

111.png

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 ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

Since the JS Console also acts as an editor, Do you get the same issue if you test a few lines of that script from the JavaScript Console?

 

In fact, what errors can you spot in JavaScript Debugger console when you execute the script? Any syntax errors?

 

Just for troubleshooting purposes I would suggest to use another text editor.

 

Notepad++ might proove to be a good choice. 

 

Nevertheless, assuming that your current MS Notepad text editor is the underlying problem, there are three good points in the Adobe Acrobat SDK, Developing Acrobat Applications Using JavaScript. Starting on page 26, "Using an extetnal editor":

 

* You must save the file in order for Acrobat to detect the changes

 

* Acrobat is inaccessible while the external editor is in use

 

* JavaScript code cannot be evaluated within the external editor.

 

In addition , on page 27 there is a good list of different external editors recommended for Acrobat, see the section "Supported external JavaScript editors with command line templates".

 

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 ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

i am now using notepad ++, what encoding should i use for this?

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 ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

you can test between ANSI or UTF-8.

 

According to their support notes, if you save to UTF-8, save without the byte order mark.

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 ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

++Adding to the discussion,

 

seems like a unicode or character mapping issue since you're copying and pasting from Notepad into the Acrobat JS editor.

 

If you're on MS Windows 10 there is a regional setting that you can disable and see if this helps.

 

But before I go there, when you click on the Format tab in the File Menu bar of Notepad, there are two areas of interest.

 

See if enabling or disabling the"Wordwrap" preference do any difference.

 

Also when you click on Font, notice below in that dialogue window where it says "Script".

 

You may have a different localization or language in your OS than the English default language of Acrobat. You may also try and change the Font script in notepad from Western to Central European or viceversa and see if that also helps.

 

I may be totally wrong though, but these are just a suggestions that may be useful if you're copying and pasting between two different programs, specially if one of them is not natively and fully supported by the operating system.

 

So the other approach that I've used successfully before, is disabling the "Beta: Use Unicode UTF-8 for worldwide language support"

 

Disable this option if you can confirm that the current system locale (language) of your OS is different than some of your programs.

 

You can find this setting via Control Panel---"Region"--- click on the "Administrative" tab, then click on "Change system locale".

 

The pop up dialogue box that will open provides the option to disbale the setting that I mentioned above.

 

 

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 ,
Feb 26, 2021 Feb 26, 2021

Copy link to clipboard

Copied

You can use this free tool to convert items string to Unicode: https://www.abracadabrapdf.net/utilitaires/utilitaires-pdf/texte-vers-unicode/

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 ,
Feb 26, 2021 Feb 26, 2021

Copy link to clipboard

Copied

LATEST

Thank you JR!

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