Error Reference

CSV import encoding error: invalid character in file

CSV import encoding error: invalid character in file

Where this appears

This error appears in the ServiceNow import log when attempting to import CSV files through System Import Sets or Data Sources. The error is displayed in the Transform History record or Import Set table, indicating the CSV file contains characters that cannot be parsed as UTF-8 encoding.

Sourdough
Chrome Extension

Debugging this in a real instance?

Sourdough lets you trace "CSV import encoding error: invalid character in file" through system logs, script errors, and API health in the ServiceNow tab you are already using.

Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Cause

The CSV file was saved with Windows-1252 or Latin-1 encoding instead of UTF-8, commonly occurring when exporting from Excel or older applications. (high likelihood)

The CSV file contains special characters, accented letters, or symbols that were not properly encoded during file creation or export. (high likelihood)

The file was created or edited on a system with different locale settings that defaulted to a non-UTF-8 character encoding. (medium likelihood)

The CSV file contains invisible or control characters such as BOM (Byte Order Mark) or other non-printable characters that conflict with UTF-8 parsing. (medium likelihood)

Data corruption occurred during file transfer or storage, causing invalid byte sequences that cannot be interpreted as valid UTF-8 characters. (low likelihood)

Fix

Step 1: Navigate to System Import Sets > Administration > Import Sets to locate the failed import and review the error details in the Transform History or Import Log.

Step 2: Open the original CSV file in a text editor like Notepad++ or VS Code and check the encoding displayed in the status bar or file properties.

Step 3: If using Notepad++, go to Encoding menu and select 'Convert to UTF-8' or 'Convert to UTF-8-BOM', then save the file with a new name.

Step 4: For Excel files, open the CSV in Excel, then use Save As and select 'CSV UTF-8 (Comma delimited)' from the file type dropdown instead of regular CSV.

Step 5: Verify the converted file by opening it in a UTF-8 capable text editor and checking that special characters display correctly without question marks or boxes.

Step 6: Re-attempt the import in ServiceNow using the newly converted UTF-8 file through the same Import Set or Data Source configuration.

Step 7: If the error persists, examine the specific row and column mentioned in the error log to identify and manually correct any problematic characters.

Step 8: Consider using the ServiceNow Excel import feature instead of CSV if the data source frequently contains special characters or formatting.

Test Your Knowledge

Quick 3-question quiz. See how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue