Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7063077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:40:15+00:00 2026-05-28T04:40:15+00:00

I am trying to make a basic webclient call to get an xml stream

  • 0

I am trying to make a basic webclient call to get an xml stream for a post tracking app for WP7. It does work and I do get the xml but the problem is as I am living in Sweden we have special characters as å ö ä etc. and for these characters I only get a box with questionmark inside.

The xml file I want to get looks like this:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?> 
<pactrack version="2.0" date="Sat Jan 14 18:29:26 CET 2012" size="2125" lang="SE">
    <header>
        <noofparcelentries>1</noofparcelentries> 

...

So the encoding is ISO-8859-1 and i guess that is my problem. Been trying to read around here on the forum for a solution and some say that the format is supported while some not:
Reading iso-8859-1 rss feed C# WP7

I been trying to add differnt encodings to the client but nothing seems to help, my xml is missing the special symbols always. There is however a strange behavior that kinda freaks me out, if I add a wrong tracking number, and instead of numbers put in special characters I can suddenly read some of the special characters,the xml I get from the server is an error message containing the tracking number, see below, but the xml definition is the same.

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<pactrack version="2.0" date="Sat Jan 14 18:34:43 CET 2012" size="389" lang="SE" >
<header>
<noofparcelentries>1</noofparcelentries>
<noofuniqueparcels>1</noofuniqueparcels>
</header>
<body>
<parcel id="8538öööåå54248SE">  //I can read this road of xml suddenly
  <customerref></customerref>
  <internalstatus>0</internalstatus>

Anyone have any ideas? I am a beginner and totally lost by this problem so any help would be greatly appreciated! Is there any difference in the first xml and the second? It seems to me maybe I cant see special charters that are nested in nodes, can that be the problem?

    WebClient client = new WebClient();

    public MainPage()
    {
        InitializeComponent();
        client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
        client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
    }

    void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
    {
        if (e.UserState as string == "mobiforge")
        {
            txtStatus.Text = e.BytesReceived.ToString() + "bytes received.";
        }
    }

    public void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
    {
        if (e.Error == null && !e.Cancelled)
        {
            MessageBox.Show(e.Result);
        }
    }

    private void btnDownload_Click(object sender, RoutedEventArgs e)
    {          
       client.DownloadStringAsync(new Uri("http://server.logistik.posten.se/servlet/PacTrack?lang=SE&kolliid=85380954248SE"), "posten"); 
    }  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:40:16+00:00Added an answer on May 28, 2026 at 4:40 am

    According to this MSDN page, only these four encodings are supported in Silverlight:

    • utf-8 UTF8Encoding

    • utf-16 UnicodeEncoding (little-endian)

    • utf-16BE UnicodeEncoding (big-endian)

    • utf-16LE UnicodeEncoding (little-endian)

    According to one of the answers in your link, the user has managed to get it to work with a slight tweak to the upper half of the characters. I assume that didn’t work for you?

    Instead of DownloadStringAsync, you could download the raw bytes (OpenReadAsync) and perform your own encoding on the raw bytes. This program might help you get started with that aspect.

    Edit – Noticed a comment at the bottom the MSDN page stating that ISO-8859-1 is supported. What happens when you try this:

    client.OpenReadAsync(new Uri("http://server.logistik.posten.se/servlet/PacTrack?lang=SE&kolliid=85380954248SE"), "posten");
    

    Then, in your callback, read the data with the encoder.

    var enc = Encoding.GetEncoding("iso-8859-1");
    using (var reader = new StreamReader(e.Result, enc))
    {
         var result = reader.ReadToEnd();
         Debug.WriteLine(result);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a program which does a very basic calculation, but
I am trying to make a basic iphone app that shows nearby tweets. I
I'm trying to make a BASIC roulette script. Is there anyway to get the
Hey guys I'm trying to make a basic calculator (polish style) but can't figure
I'm trying to figure out how make a basic GET request using Network.HTTP.simpleHTTP that
I am trying to make a very basic REST call to my MVC 3
I'm trying to make a basic (Mario style) game but my sprite(plumber) doesn't appear,
I'm just trying to make the basic Selenium2Example work with Firefox 4 using Maven
I am trying to make a basic quotation-sharing app using Webapp. Obviously it is
I'm trying to make a very basic image creator using PySide. But I'm having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.