"""
Parser for Netscape Navigator's and Mozilla's bookmarks.html
- Written by BroytMann. Copyright (C) 1997-2004 PhiloSoft Design
+ Written by BroytMann. Copyright (C) 1997-2005 PhiloSoft Design
"""
else:
global DEFAULT_CHARSET
DEFAULT_CHARSET = sys.getdefaultencoding()
+ if DEFAULT_CHARSET == "ascii":
+ try:
+ import locale
+ except ImportError:
+ pass
+ else:
+ DEFAULT_CHARSET = locale.getpreferredencoding()
def start_title(self, attrs):
keyword = value
debug("Bookmark points to: `%s'" % href)
- bookmark = Bookmark(href, add_date, last_visit, last_modified, keyword)
+ bookmark = Bookmark(href, add_date, last_visit, last_modified, keyword or '')
self.current_object = bookmark
self.current_folder.append(bookmark)
self.urls += 1