Discussions related to Visual Prolog
- Posts: 18
- Joined: 7 Feb 2006 13:42
Has the Hanoi Towers example been tested on the VP 9 release?
My test shows the error:
The server encountered an internal error and was unable to complete your request.
End of script output before headers: hanoi.exe
Thomas Linder Puls
- VIP Member
- Posts: 1194
- Joined: 28 Feb 2000 0:01
I am afraid that it is long time since we have tested this.
It will work if you change the last part of the "hanoi.pro" file like this:
Code: Select all
docBegin = @'Content-Type: text/html; charset=UTF-8
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
docEnd = @'
O = outputStream_console::new_stdout(),
stdio::outputStream := O,
ParmList = cgi::getParamList(),
end implement hanoi
The important changes are:
- The goal should use mainExe::run (it should not initialize the console)
- The stdio::outputStream should be set manually to an outputStream_console::new_stdout() stream.
- I will recommend that you use UTF-8 for encoding your HTML.
- The output stream should be set to that mode
- The chosen encoding should be stated as part of the "Content-Type" HTTP header
- I also recommend that you supply a "meta" http-equiv element that also gives the ContentType (It may be overkill)
- <!DOCTYPE html> says that the content is html5
- Notice that it is essential that there is a blank line between the HTTP header and !DOCTYPE
We will (in a later version) handle the stream handling in the cgi class.
Regards Thomas Linder Puls