UTF8数据库不存储西班牙语字符

I have a WordPress database where all tables are set to utf8_general_ci. Some of my script reads in a remote CSV file and stores content to the database. If there are any spanish characters it won't store anything, just null. I tried mb_convert_encoding($line[2],'UTF-8'); which now stores the data but converts the characters to question marks.

WordPress database settings in wp-config are:

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');