Re: missing charset or bung server settings?

From: Andy Hassall (andy_at_andyh.co.uk)
Date: 11/21/04


Date: Sun, 21 Nov 2004 18:15:17 +0000

On 21 Nov 2004 06:10:39 -0800, bobason456@hotmail.com (bobs) wrote:

>Hello, I was wondering if some one could take a look at the two
>example server outputs below, and help me understand what is wrong.
>I'm getting garbled characters.
>
>The php script I'm developing delivers XML to a client side
>application I'm also putting together in VB.NET .. Example 1 is my
>development PC.. It has a recent build of PDP & Apache. This output is
>good.
>
>Example 2 is the production server and is adding all sorts of strange
>characters, that are causing the XML to be invalid.
>
>I'm thinking it has somthing to do with the lack of charset in Ex2..
>perhaps. If that is the case can I specify it in the .htaccess file
>because I dont have direct control over the production server. Has any
>one seen this before?

 Both outputs look similar to me. They're chunked transfer-encoded. If you're
using the output directly, your client is broken, as it's not decoding the
chunks, which IIRC is a required capability of any HTTP/1.1 client.

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1

>******** EXAMPLE 1 *************
>
>HTTP/1.1 200 OK
>Date: Mon, 22 Nov 2004 10:34:20 GMT
>Server: Apache/2.0.52 (Win32)
>X-Powered-By: PHP/5.0.2
>Connection: close
>Transfer-Encoding: chunked
>Content-Type: text/html; charset=ISO-8859-1
>
>fcc

 Chunk size here. Indicates it's 4,044 bytes long. Presumably this covers the
entire document in one chunk.

>o;?<app><name>eek</name><author>Me</author><version>0.1</version><contact>me@.com</contact></app><link
>...
>
>
>******** EXAMPLE 2 *************
>
>HTTP/1.1 200 OK
>Date: Sun, 21 Nov 2004 13:48:28 GMT
>Server: Apache
>X-Powered-By: PHP/4.3.4
>Connection: close
>Transfer-Encoding: chunked
>Content-Type: text/html
>
>8d
 
 Chunk #1, 0x8d = 141 bytes.

>o;?<app><name>eek</name><author>Me</author><version>0.1</version><contact>Me@.com</contact></app>

 Data for chunk #1.

>2e
 Chunk #2, 0x2e = 30 bytes.

><link src="example" rank="1" type="se">

 Data for chunk #2.

>1f
><url>http://www.petz.com/>
>1b
><title>Petz Central</title>
>c5

 And so on...

 If your client can't handle this, perhaps it should be making HTTP/1.0
requests.

-- 
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool


Relevant Pages

  • Re: Partitioned decompression
    ... | This big compressed file will be transfered between a server and the ... | this chunk is requested by other peer, ... name, creation date, and comments to the client from the server. ... the server runs a checksum for every 100 KB ...
    (comp.compression)
  • Re: how to export view to display - xml with specific xsd?
    ... Also xp_cmdshell runs on the server, ... SQL Server to a file and open the file in Word on the client machine. ... It opens up a ... XML to be generated in a Word-specific XML format. ...
    (microsoft.public.sqlserver.xml)
  • Re: XML->Dataset->Database
    ... latest configuration information and the server contains completed survey ... special database tables to control the flow of information, and using XML ... based on what needs to be sent to the client, ...
    (microsoft.public.dotnet.general)
  • Re: Arch question.
    ... If you do create seperate xml classes just for webservices ... ' NameInfo and get result as type HelloResult ... >> 1) On the server, I have my server classes that don't consider any xml. ... >> 4) The client has copy of xmldoc classes as needed. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: porting Access to SQL Server --- what to do with the front-end?
    ... They are both server side languages. ... As you state, HTMl, CSS, and javascript on the client ... Requests to the server use HTTP requests which send either URL-encoded ... strings or XML documents. ...
    (comp.databases.ms-access)

Loading