]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/bkmk_rsimple.py
Send Accept-Charset.
[bookmarks_db.git] / Robots / bkmk_rsimple.py
index 7a21c4fd1a1e72faf1397df7a853194dab30f696..77ed46f178834820d2917089d3a08343e5fd98a5 100644 (file)
@@ -1,7 +1,7 @@
 """
    Simple, strightforward robot; guaranteed to has problems with timeouts :)
 
-   Written by BroytMann, Mar 2000 - Mar 2004. Copyright (C) 2000-2004 PhiloSoft Design
+   Written by BroytMann, Mar 2000 - Sep 2007. Copyright (C) 2000-2007 PhiloSoft Design
 """
 
 
@@ -91,7 +91,9 @@ class robot_simple(Robot):
             url_host, url_path = urllib.splithost(url_rest)
             url_path, url_tag  = urllib.splittag(url_path)
 
+            if bookmark.charset: urllib._urlopener.addheader('Accept-Charset', bookmark.charset)
             fname, headers = urllib.urlretrieve("%s://%s%s" % (url_type, url_host, url_path), self.tempfname)
+            if bookmark.charset: del urllib._urlopener.addheaders[-1]
 
             size = 0
             last_modified = None