Other PDF Issues

Fix Chinese Characters Disappearing When Uploading PDF Forms to SQL Server

Huda QurayshiHuda Qurayshi Nov 5, 2026 870 views

Question details

Users report that Chinese characters extracted from an electronic PDF form display incorrectly or disappear completely once the data is uploaded and stored in Microsoft SQL Server.

How to Fix Chinese Characters Disappearing After PDF Form Data is Uploaded to SQL Server
Product
Microsoft SQL Server
Device & OS
not provided
Scenario
Extracting form data containing Chinese text from a PDF file and inserting it into a SQL Server database via an application connection.
Observed behavior
The Chinese characters are lost, replaced by question marks, or rendered as garbled text upon retrieval from the SQL database.
Before you start

Before modifying your database schema or application configuration, ensure you have full administrative access to the SQL Server and back up the affected database tables to prevent accidental data loss during testing.

Solution 1Recommended

Update Database Columns to Support Unicode (NVARCHAR)

Change your SQL Server table columns to a Unicode-compatible data type so they can store multi-byte characters like Chinese text.

Standard VARCHAR columns in SQL Server use non-Unicode encoding, which generally does not support Chinese characters unless the database collation is specifically set for it. Changing the column type to NVARCHAR ensures that Unicode characters are safely stored regardless of the server's default collation.

1
Identify Affected Columns

Log into SQL Server Management Studio (SSMS) and locate the specific table and columns where the PDF form data is being inserted.

2
Modify the Column Data Type

Change the data type of the target columns from VARCHAR or CHAR to NVARCHAR or NCHAR. You can do this via the table designer or by running an ALTER TABLE SQL script.

3
Update the Insert Queries

When inserting data, ensure your application prefixes string literals with a capital 'N'. For example, use INSERT INTO TableName (ColumnName) VALUES (N'中文') instead of just using standard quotes.

Update Database Columns to Support Unicode (NVARCHAR)
Data Type Updated: Using the 'N' prefix stands for National Language Character Set and guarantees SQL Server treats the incoming string as Unicode data.

Create and Export PDF Forms Seamlessly with WPS Office

While SQL database configurations must be handled on the server side, ensuring your PDF forms are correctly built with embedded fonts and accurate UTF-8 encoding is the crucial first step to preventing data loss. WPS Office provides robust, professional PDF tools to create, manage, and export form data flawlessly.

  1. 1. Open the PDF Module: Launch WPS Office and navigate to the PDF suite to start a new document or open an existing file.
  2. 2. Create or Edit Form Fields: Use the Form tools to add interactive text fields, ensuring you select a universally supported font for Chinese characters in the field properties.
  3. 3. Export Data Safely: Fill the form and save the document. WPS Office ensures the document encoding remains intact, ready for secure extraction to your database.
Easily create and fill interactive PDF forms with native Unicode supportEnsure proper font embedding for Chinese and other global languagesHigh compatibility with standard PDF formats and Adobe Acrobat data exportsLightweight, user-friendly interface for managing all your document needs
microsoft office alternative - wps office

Frequently Asked Questions

Why do Chinese characters turn into question marks in SQL Server?

This typically occurs when the target column is configured as a non-Unicode data type like VARCHAR or CHAR. These data types do not support multi-byte characters unless a specific Chinese collation is set, resulting in the database replacing unrecognized characters with question marks.

How can I tell if the data loss happens during PDF extraction or SQL insertion?

You can isolate the issue by logging the extracted data to a plain text file (saved in UTF-8) immediately before your application executes the SQL INSERT command. If the characters look correct in the text file, the database or connection string is at fault. If they are already corrupted, the issue lies within the PDF extraction logic or the PDF file itself.

Does the PDF software used to fill the form affect the encoding?

Yes. If the PDF viewer or editor used by the person filling out the form does not properly handle Unicode or fails to embed the required Chinese fonts, the form data may be saved with corrupted encoding, making it impossible to extract the text accurately later.