How to Fix Broken Romanian and Special Characters in Adobe Acrobat JavaScript
Question details
Users experience broken characters or question marks when populating PDF text fields using external JavaScript files containing special characters and Romanian diacritics.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Populating PDF text fields using external JavaScript files.
- Observed behavior
- Special characters and Romanian diacritics (like ș, ț, î) display as broken characters or question marks.
Ensure you have access to the original external JavaScript file and a plain text editor like Notepad++ before proceeding.
Convert JavaScript File Encoding to UTF-8
Changing the external file's encoding to UTF-8 (without BOM) ensures that Adobe Acrobat interprets and displays special characters correctly.
When writing scripts in an external editor, the file may default to ANSI or another localized encoding. Adobe Acrobat requires UTF-8 to correctly process extended Unicode characters, such as Romanian diacritics.
Launch Notepad++ or your preferred code editor and open the external JavaScript file containing your code.
Click on the 'Encoding' menu at the top of the window and select 'UTF-8' (or 'Convert to UTF-8'). Avoid using UTF-8 with BOM, as it can occasionally cause script parsing errors.
Save the file to apply the new encoding formatting.
Copy the updated JavaScript code and paste it back into your Adobe Acrobat document's script editor, or re-import the file if you are running it externally.

Use WPS PDF for Flawless Text and Form Editing
WPS Office includes a robust PDF editor that natively supports diverse character sets, making it easy to create, edit, and fill out PDF forms without dealing with complex JavaScript encoding issues.
- 1. Open your PDF: Launch WPS Office and open your PDF document using the built-in WPS PDF tool.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to access interactive form fields.
- 3. Edit Text Fields: Double-click on any text field to directly input or paste your text, including Romanian diacritics, without needing to write external scripts.
- 4. Save the Document: Click 'Save' to preserve your inputs with perfect character formatting intact.

Frequently Asked Questions
Why do special characters appear as question marks in PDF forms?
This usually happens when the text or script is imported using an encoding format like ANSI that does not support extended character sets. Using UTF-8 ensures all special characters are interpreted correctly.
Can I fix this issue without using Notepad++?
Yes, you can use any text editor that allows you to change file encoding. In Windows Notepad, you can choose 'Save As' and select 'UTF-8' from the Encoding dropdown menu before saving the script.
Does BOM (Byte Order Mark) affect JavaScript in PDFs?
Yes, including a BOM in your UTF-8 file can sometimes cause syntax errors or unexpected behavior in Adobe Acrobat's JavaScript engine. It is recommended to use standard 'UTF-8' or 'UTF-8 without BOM'.
How do I insert Romanian diacritics directly into a PDF?
If you have the correct keyboard layout installed on your operating system, you can type Romanian diacritics directly into the PDF text fields. Ensure the chosen font in the PDF supports those specific glyphs.




