,

‘’, hexadecimal value 0x1A, is an invalid character

This error message appears from time to time when importing data to a SharePoint List from an ODBC data source (in this case, it was SQL Anywhere). I’m using a tool developed by Thor Projects to transfer data from any ODBC data source to a SharePoint list. The issue happens at the core of ClientContext in Microsoft.SharePoint.Client.DataConvert.WriteValue_String(XmlWriter writer, Object objValue) A few ways to address this issue. I’ll focus on the right answer. Ask the client to clean up their data. I like to be helpful so I’ll send them the exact records to fix.

Using the Db2CSV tool, also developed by Thor Projects, I’ll export the data into an easily parseable text file. Then run a Power Shell command to identify any rows that have non-ASCII characters.

Get-Content myexportedfile.csv | Where-Object { $_ -cmatch ‘[^\x20-\x7F]’ } | Set-Content -Encoding utf8 offendingrows.

To test, excluded the output rows from the original query. The utility ran without any issues.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *