At first I thought the problem was when I return echo json_encode($row) from an ajax call that results with ñ are changed to NULL. But after testing I found out that the problem
Face the same issue with the string "CASTAÑO".
I've tried posted solutions.
I used the ini_set('default_charset', 'utf-8'); directive.
ini_set('default_charset', 'utf-8');