Click here to Skip to main content
14,423,036 members

Forcing Google to return an XML Calendar feed in English ?

BillWoodruff asked:

Open original thread
I am doing a small application for a friend that accesses his Google calendar. Developing it in Visual Studio 2010, as a WinForms project, compiled against FrameWork 3.0, so my friend can use it on a PC running Win XP. I am located in S.E. Asia.

The Google Calendar created by my friend uses English for all its entries.

I successfully capture the Calendar's XML using the typical WebRequest, and StreamReader objects: no problem there.

The problem is that the XML returned includes Calendar Event entry-data encoded in a non-Roman character Asian font: I assume this is happening because Google is reading my IP address, and "decides" I must want the Event data back in the native character set of the country I am in.

Observations:

0. changing the Calendar link prefix from "https:" to "http:" has no effect on the XML returned.

1. In the current XML returned I can see both Unicode coded characters in "#1234" format, and glyphs in the Asian non-Roman font.

2. Adding "?lan=en" to the end of the Calendar link does not result in English-only XML. That was one suggestion I found on Google's developer site.

3. If I launch Chrome and enter the link to the calendar feed: all XML content is returned in English only. So the problem is somehow specific to making a WebRequest from ".NET"

4. If I try the link in Internet Explorer 9, the resulting page does display non-Roman alphabet content.

So, the question is: how to force Google to return English-language only results from pulling down a Google Calendar feed in XML format, from .NET using WebRequest.

thanks ! Bill
Tags: C#, XML, RSS

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100