Click here to Skip to main content
14,428,597 members
Rate this:
Please Sign up or sign in to vote.
See more:
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.


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
Updated 2-Jan-13 15:01pm
Some notes:

OK, could you show the URL, and, I don't know, maybe some other detail? Basically, this is all internal business of the site/service, you should understand it. It will respond with whatever "it wants". The question is: what?

HTTP or HTTPS is not "prefix"; this is "scheme". They use different protocols, and, in general case, if the rest of URI is the same, what you get are conceptually two different Web sites.
If you have a desired result in Chrome, you can fully simulate it using HttpWebRequest. You can try to spy on packages. You can even make your own spy. The easiest way it to make it a proxy code and set up the browser with that proxy.

Anyway, you can probably find all the ends if you put some effort in it. Need more help?

Rate this:
Please Sign up or sign in to vote.

Solution 1

Not too tricky. :-) If you look at Google advanced search page, you will find the field "Language":[^] :-).

BillWoodruff 2-Jan-13 19:56pm
Thanks, Sergey, You may have answered before I revised the question.

In this case, this is about accessing an RSS feed using .NET via WebRequest; it is not about doing a browser-search. In a Chrome browser-search you can use syntax like "&lr=lang_en" to force English language only results.

And, as I note in the revised question: in this case adding "?lan=en" doesn't work either.

Please see the newly revised question, if you have time.

yrs, Bill
Sure. I added some comments, but to the modified questions...
Rate this:
Please Sign up or sign in to vote.

Solution 2

to the URL worked for me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

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