I have a PHP script that reads from a CSV file, the file is in UTF-8 format and the code below is treating it as ASCII. How can I change the code to read the file as UTF-8?
if (($handle = fopen("books.csv", "r")) === FALSE)
throw new Exception("Couldn't open books.csv");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
[EDIT] One of the issues with my current code is that the first value on the first line always has the three bytes that identifies UTF-8 files appended at the beginning. So I guess a solution that operates on a value by value or a row by row might not be good enough?