Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Development

overrideMimeType() on Leopard and Tiger

Author Message
chokladzingo



Joined: 08 May 2005
Posts: 1
Location: Lund, Sweden

Posted: Thu Dec 06, 2007 - 3:18 am    Post subject: overrideMimeType() on Leopard and Tiger Reply with quote

I am developing a widget that fetches bus departures from the bus stops in my city. Swedish street names generally contains a lot of , and characters which means that character encoding becomes an issue. If XMLHttpRequest is unable to find a character encoding all non-ASCII characters will be replace by the Unicode replacement character, which doesn't look too good.

The data is downloaded from URL:s like http://194.16.222.120/realtidlunddll/vemos2_web.dll/hpl.wml?hplnr=81126. The WAP-page sent by the server is lacking the XML-encoding attribute and there is no encoding specified in the HTTP Content-Type header. Since the server is out of my reach I have dealt with this in a number of ways, including setting up a proxy which adds the encoding attribute using PHP and also adding it locally after download. This works pretty good, but I feel it's a bit too much of a hack.

The other day I discovered that I could get my widget to download the data correctly by calling xmlhttp.overrideMimeType("text/xml; charset=iso-8859-1"). This works great in Leopard but unfortunately it is not working in Tiger. As I understand it this should work in Tiger as well, but it doesn't. Does anyone know how I can set the character encoding in XMLHttpRequest on Tiger as well?
View user's profile Send private message Send e-mail Visit poster's website Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group