Create Webpage with UTF8 content in WAM (RESOLVED)
Posted: Fri Oct 18, 2019 12:15 pm
I have a WAM with a Response(#http1) and I'm build a webpage containing UTF8 string (*NVARCHAR)
I'm building the page
#workutf8 := '<html><head>'
...
#workutf8 += #ONXTX8
...
#workutf8 += '</body><html>'
#MyFile.CreateTemporaryFile
#MyFile.WriteAllText Text(#workutf8)
#http1.ContentFile := #MyFile
#http1.ContentType := 'text/html'
#http1.RemoveFile := true
This displays a page of junk (little square boxes lots of letters wth accents etcetera).
If I remove the content type the page is downloaded but readable.
Any ideas about what I'm doing wrong.
I'm getting utf-8 from an external source ad I need to to display it without losing anything which I can't do with WEBEVENT.
If I build the file as above on the iseries as '\home\myfile.html' it displays beautifully in the browser.
I'm building the page
#workutf8 := '<html><head>'
...
#workutf8 += #ONXTX8
...
#workutf8 += '</body><html>'
#MyFile.CreateTemporaryFile
#MyFile.WriteAllText Text(#workutf8)
#http1.ContentFile := #MyFile
#http1.ContentType := 'text/html'
#http1.RemoveFile := true
This displays a page of junk (little square boxes lots of letters wth accents etcetera).
If I remove the content type the page is downloaded but readable.
Any ideas about what I'm doing wrong.
I'm getting utf-8 from an external source ad I need to to display it without losing anything which I can't do with WEBEVENT.
If I build the file as above on the iseries as '\home\myfile.html' it displays beautifully in the browser.