having issue on device with file:read (I think)

The app is working fine in the Corona simulator in my PC but when I build the .apk and install it on a device there is a part where it doesn’t. Device I’m testing on: Android (galaxy tab)
After using logcat, apparently this is the part where it bugs out but I can’t find the problem:

[code]
local html2text = require( “html2text” )
local self = event.target
local id = self.id

local function urlDownload ( event )

if ( event.isError ) then
print ( “Network error - download failed” )
detailScreenText.text = “Network error, download failed\nRetry”
else
local filePath = system.pathForFile( “htmlDownload”, system.TemporaryDirectory )

– io.open opens a file at path. returns nil if no file found
local fh, reason = io.open( filePath, “r” )

if fh then
– read all contents of file into a string
local htmlContent = fh:read( “*a” )
io.close( fh )
os.remove( filePath )

print(htmlContent)
detailScreenText.text = html2text.htmlToText({ caller = “menuNotizie”, text = htmlContent})
end
end
end

network.download( urls[id], “GET”, urlDownload, “htmlDownload”, system.TemporaryDirectory )[/code]

Practically what I’m trying to do is gettind the html code from an url and then I send it to html2text to strip out html codes and stuff. The error seems to be before I call the html2text module in the fh:read because the print(htmlContent) in logcat is printing this:
I/Corona ( 4666): ?ï
which then causes an error in the html2text module because all the pattern matching fail. While in the Corona Simulator everything works fine, in that same print I get the normal html code of the page.
Is there something I’m doing wrong?
Thanks in advance [import]uid: 165560 topic_id: 30894 reply_id: 330894[/import]