Page 1 of 1
Hanoi project in VP9
Posted: 23 Nov 2020 14:46
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
Re: Hanoi project in VP9
Posted: 24 Nov 2020 13:29
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.