Apache on windows generates an incorrect Content-length because \n is converted to \r\n if stdout is a terminal unless it is set to binary mode This patch fixes the issue: Apache on win32 using CGIXMLRPCRequestHandler returns incorrect Content-length