What in the Wide World of ?? Is Going On With My CSV Import?

Author by Christopher Mank

Once again I found myself working on some custom connectors and importing the data via a CSV Import.  Since this connector is for a global organization, the data contains many special and foreign characters (á, é, ñ, ü, etc.). Following the same design as other connectors, I export the data to a CSV file and run a PowerShell command to import the data.  However, I noticed something odd when trying to import data that contains these special characters.  Instead of displaying the proper character, it puts a "?" in its place.  Let's see an example. I have a user like the one pictured below.  If you notice his title, the word Béisbol is missing the accent mark over the "e" (which is the proper Spanish spelling). SCSM User with no foreign characters Image Well that's an easy fix, right?  We just create a simple CSV import file to update this user's title with the correct spelling and we should be all good. SCSM User Import Format File Special Characters Image But after we import the file and update the user object, you'll notice something odd about our new title.  Instead of importing the é, it put a question mark in its place.  Say it ain't so CSV import, say it ain't so!  So what's going on here? SCSM User with question marks Image The answer lies in the encoding of the CSV file.  More often than not, the CSV files you use to import are using the default setting, which is the ANSI encoding.  However, if we want to import data that contains foreign characters, we need to use an encoding that supports every type of character, like UTF-8. So what's the solution?  It's pretty simple actually.  Open your CSV file in something like Notepad and do a Save As, selecting the UTF-8 encoding. SCSM CSV Import UTF Encoding Image Complete your CSV import and you now have foreign characters and the correct spelling. SCSM User with foreign characters Image Remember, if you build it, they will come :-) Until the Whole World Hears, Christopher
Author

Christopher Mank

Systems Architect