How can I make Drupal/MySql accept special characters in ANSI (without changing the file's encoding)?
Found it. I just needed to encode the values with:

$encodedval = mb_check_encoding($val, 'UTF-8') ? $val : utf8_encode($val);