473,405 Members | 2,444 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,405 software developers and data experts.

receiving XML content - ISO-8859-1

Hi.
I receive XMLcontent codded in ISO-8859-1.
XML file contains Polish character set so that i need to notice somehow
when they are coming. My program cuts this characters and replaces them
with "". I have english copy of windows.
What am i dooing wrong here.
Any help would be appreciated
Thanks
try
{
HttpWebRequest request = null;
HttpWebResponse response = null;

request =
(HttpWebRequest)WebRequest.Create(address);

request.Headers.Clear();
request.ProtocolVersion = HttpVersion.Version11;

response = (HttpWebResponse)request.GetResponse();

string header2 = response.Headers.Get("Auth");
if (header2 != "true") throw MyException;

Stream responseStream =
response.GetResponseStream();
StreamReader streamReader = new
StreamReader(responseStream);

StreamWriter sw = new StreamWriter("~temp.xml");
string temp = null;

while (true)
{
temp = streamReader.ReadLine();
if (temp == null) break;
//HERE TEMP ALREADY HAS "" INSTEAD OF SPECIAL
CHARACTERS
sw.Write(temp);
}

response.Close();
sw.Close();
}

Nov 24 '06 #1
1 1596
Piotrekk wrote:
I receive XMLcontent codded in ISO-8859-1.
XML file contains Polish character set so that i need to notice somehow
when they are coming. My program cuts this characters and replaces them
with "". I have english copy of windows.
What am i dooing wrong here.
You're using StreamReader and StreamWriter, which use UTF-8 by default.
As you're only trying to dump the contents of the response stream to
disk, just use a stream directly.

Jon

Nov 24 '06 #2

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

Similar topics

8
by: Stromboli | last post by:
Hi, I have my site available in a couple of languages most of the files are indexf.html (french), indexi.html (italian) and indexde.html (german).. I'd like to start using multiviews but I've...
5
by: LS | last post by:
Can a WebMethod return an Interface type? Can we pass an interface parameter ? Example : public interface IEntity { long Id { get; set; } string Name { get; set; } }
2
by: achoo | last post by:
I have two versions of the same program that send requests to a Web service. One version is a Windows application written in C#, and it properly handles a cookie created by the Web service. All...
8
by: nospam | last post by:
I have an piece of software that is sending an HTTP POST request to an ASP.Net page. The data posted consists of a chunk of XML data. For some reason (Based on my net research, and my tests at...
3
by: WoodenSWord | last post by:
Hello, I am just wondering what is the best practice for sending/receiving XML Files Through a web service method. For example: 1) As a string <WebMethod()> _ Public Function...
1
by: stroumf | last post by:
Hi, Simple question, I want to receive compressed data from a server using AJAX. At the client I make an xmlHttpRequest. Next I want to set the accept-header to Gzip, but I keep getting errors...
1
by: Subrato | last post by:
Hi, I am very new to xml and I have this piece of code which I took off a website. The situation is that on of the website, user files up a form and it is submitted. On submission, the page should...
0
by: george585 | last post by:
Hello! I am new to network programming, and understand just basics. Using some sample code, and having read documentation, I managed to create a simple app in C# and VB.NET. The application is...
3
by: Tarik Monem | last post by:
Hi Everyone, Still a newbie with FLEX, and I've passed arrays using AJAX to FLEX before, but I've never passed links to FLEX. Basically, this is the OUTPUT, which I wanted, but I'm given an...
5
by: hurricane_number_one | last post by:
I am creating a simple server application, that will listen for incoming mouse coordinates and then move the mouse accordingly. So basically it's like a very simple VNC server without and screen...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.