473,394 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

missing charset or bung server settings?

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?

Thanks
DaveC

******** 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
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
o;?<app><name>eek</name><author>Me</author><version>0.1</version><contact>Me@.com</contact></app>
2e
<link src="example" rank="1" type="se">
1f
<url>http://www.petz.com/</url>
1b
<title>Petz Central</title>
c5
Jul 17 '05 #1
2 1601
bobs wrote:
<snip>
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?

<snip>

Don't know if it helps, but you can try header() in the PHP script.
http://www.php.net/header
header('Content-Type: text/xml; charset=ISO-8859-1');
/* Why text/html? ^^^^^^^^ */

--
Mail sent to my "From:" address is publicly readable at http://www.dodgeit.com/
== ** ## !! !! ## ** ==
TEXT-ONLY mail to the complete "Reply-To:" address ("My Name" <my@address>) may
bypass the spam filter. I will answer all pertinent mails from a valid address.
Jul 17 '05 #2
On 21 Nov 2004 06:10:39 -0800, bo********@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/....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/</url>
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 / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: CJ Oxx | last post by:
I have a problem with browser charset recognition when using PHP 4.1.2 (this is the PHP version which our hosting company provides). For charset recognition, I use the following meta-tag: <meta...
1
by: Tux | last post by:
when I start Eclipse in Mandrake 9.1 I got a message: Warning: missing charset in String to FontSet conversionOpener What can be wrong? Is it error in OS or in Eclipse installation?
15
by: Ben Sharvy | last post by:
I hae a page which validates, but produces a warning about a charset mismatch. The warning claims I specify a charset in the http header. I don't specify a charset in the http header. What gives?...
4
by: downlode | last post by:
Hi, I am writing to a text column in my SQL Server 2000 database. The text comes from a web form in my java web application, where the character encoding is ISO-8859-1. (I have no control over...
4
by: Rémi | last post by:
Question: How can you determine the character set used by a webpage you built? My understanding of the issue is that the character set used by an HTML file (or any other file, for that matter)...
3
by: mistral | last post by:
how to set correct charset type for multi-language website? Site is on cms, and same headers are dynamically generated for all pages. The recommened charset type is <meta http-equiv="Content-Type"...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
3
by: gudiya | last post by:
hi, My code works but i am missing the first 2 characters of file name. Any idea why???? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;...
7
by: =?Utf-8?B?QU9UWCBTYW4gQW50b25pbw==?= | last post by:
Hi, I have been using the code (some of it has been removed for simplicity) below to allow authenticated (using ASP.NET membership database) users to get a file from their archive area. It...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.