Fix Special Characters in Acrobat app.response JavaScript
Question details
The user needs to fix an issue where accented or special characters display incorrectly in an Adobe Acrobat app.response dialog when the script is run from an external JavaScript file.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Executing a folder-level external JavaScript file containing special characters to trigger a prompt dialog in Acrobat.
- Observed behavior
- Accented characters display correctly when the JavaScript is embedded directly into the document, but appear garbled or incorrect when stored in an external folder-level file.
Ensure you have access to a capable external text editor (such as Notepad++, BBEdit, or Visual Studio Code) that allows you to view and manually adjust the character encoding of your script files.
Change the External JavaScript File Encoding to UTF-8
Converting your external JavaScript file to UTF-8 ensures that Adobe Acrobat correctly interprets and renders special accented characters.
When Acrobat executes a folder-level script, it relies on the external file's encoding to read characters. If your text editor defaults to ANSI or another localized encoding system, special characters in the app.response prompt will appear garbled. Adobe Acrobat natively supports Unicode strings, provided the file itself is saved properly.
Right-click your external folder-level .js file and open it using a robust text editor like BBEdit (Mac) or Notepad++ (Windows).
Look for the 'Encoding' menu item at the top of the editor, or check the document properties displayed in the bottom status bar.
Select the option to 'Convert to UTF-8'. If your editor offers multiple UTF-8 options, choose 'UTF-8 without BOM' (Byte-Order Mark) to ensure maximum compatibility with Acrobat's JavaScript engine.
Scan your script for any characters that may have been permanently corrupted during previous saves, and manually re-type the correct accented characters in your app.response strings.
Save the file, restart Adobe Acrobat to force it to reload the folder-level scripts, and trigger your script to verify the dialog displays correctly.

Use Unicode Hexadecimal Escapes
If changing the file encoding is not possible, you can represent special characters using their Unicode escape sequences within the string.
Experience a Lighter, Faster PDF and Office Suite
Dealing with complex script configurations in heavy PDF editors can be frustrating. Try WPS Office, a comprehensive, free, and lightweight alternative that includes powerful PDF reading and editing tools alongside robust Word, Excel, and PowerPoint alternatives. Enjoy seamless format compatibility and a familiar, easy-to-use interface.

Frequently Asked Questions
Why do accented characters work in document-level scripts but not folder-level scripts?
Document-level scripts are saved within the PDF document itself, and Adobe Acrobat automatically manages the internal character encoding. Folder-level scripts are stored as external files on your computer, making their encoding entirely dependent on the default settings of the text editor used to create them.
What is the difference between UTF-8 and UTF-8 with BOM?
BOM (Byte Order Mark) is a hidden marker at the very beginning of a file that indicates the text is Unicode. Some specific Acrobat versions or script engines might misinterpret the BOM as a syntax error. Saving as 'UTF-8 without BOM' prevents this issue while keeping the characters intact.
Can I use Acrobat's built-in editor to write folder-level scripts?
Acrobat's built-in JavaScript editor is designed for document-level, field-level, and action scripts. Folder-level scripts require you to create external .js files and place them in the application's JavaScript directory, which necessitates using a third-party text editor.




