Hi!, thanks for taking some time to study this, and sorry for not showing up (I got the flu and wasn't able to work).
I created a small program that basically does the same as the CGI (read the file name from the database in UTF8, and open that file from the mounted filesystem)...and it worked!.
So, now I'm starting to think the problem is related to the CGI and/or the Apache24 web server.