简体   繁体   中英

Difficulty reading .csv file

I am trying to read in a .csv file (output from Excel) in C. I assumed the file would only be text values, but I have found 3 characters at the beginning of the file. They are (unsigned char): 239, 187, 191.

Since I am not expecting these values, my reader gets confused and causes problems. But I have not been able to find documentation. I saved the file as a UTF-8 .csv file from Excel.

The UTF-8 representation of the BOM (byte order mark) is the (hexadecimal) byte sequence 0xEF,0xBB,0xBF. These may be displayed as the characters .

In decimal, these values are 239, 187, and 191 as shown above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM