# SFTP download of CSV file does not seem to be UTF-8 encoded - is there an option for this?

**URL:** https://www.finalbuilder.com/forums/t/sftp-download-of-csv-file-does-not-seem-to-be-utf-8-encoded-is-there-an-option-for-this/7193
**Category:** Discussion
**Created:** [March 21, 2022, 2:24pm UTC](https://www.finalbuilder.com/forums/t/sftp-download-of-csv-file-does-not-seem-to-be-utf-8-encoded-is-there-an-option-for-this/7193 "2022-03-21T14:24:06Z")
**Posts on this page:** 1
**Showing post:** 18

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [March 24, 2022, 11:44pm UTC](https://www.finalbuilder.com/forums/t/sftp-download-of-csv-file-does-not-seem-to-be-utf-8-encoded-is-there-an-option-for-this/7193/18 "2022-03-24T23:44:00Z")

</div>

Hi Jonathan

This whole encoding issue stems from the fact that :

a) until recently, the csv iterator action only supported ANSI or UTF-16 - that was due to us using the Scripting.FileSystem com object - which is provided by windows but no longer updated. It was unable to deal with files that have a Byte Order Mark - this was an issue that you reported in this post [CSV Iterator and IF Statement bug](https://www.finalbuilder.com/forums/t/csv-iterator-and-if-statement-bug/7168)

b) In order to handle files with different encodings - we check for a byte order mark (which indicates the encoding) - if that doesn’t exist we fall back to UTF-8 - which is a superset of ANSI so will handle ansi files just fine.

c) Your files have no BOM (so encoding cannot be determined) and invalid bytes `0xA0` in them which is neither valid ANSI or UTF-8. This is what causes the error you are seeing. I loaded up your sample file in a bunch of editors, some loaded them without complaining (until I tried to save) - some complained about the encoding (either invalid ascii or invalid utf-8 continuation).

I guess the Scripting.FileSystem com object was more lenient when it comes to handling invalid characters - however it barfed on files with BOM’s - we can’t win.

I’m currently exploring other options - I did get it to work by not specifying a default encoding - however I now need to test with other encodings to see how it handles them.

---

_[View the full topic](https://www.finalbuilder.com/forums/t/sftp-download-of-csv-file-does-not-seem-to-be-utf-8-encoded-is-there-an-option-for-this/7193)._
