X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=doclib%2Ffix-links.py;h=fb7450eb4d564cb90ae0d62fe5935e365e513047;hb=2d54670ccdd4125df7dbb897afde882b6ec505ee;hp=2fe5db6e9d886997c00dfd993a9b19490b9c592c;hpb=fe593b5092295224c1f4334bcc97801d2cf41b89;p=senf.git diff --git a/doclib/fix-links.py b/doclib/fix-links.py index 2fe5db6..fb7450e 100644 --- a/doclib/fix-links.py +++ b/doclib/fix-links.py @@ -26,7 +26,7 @@ # index. Doxygen seems to create links with the wrong number of 'g' # charachters in front sometimes. -import sys,os.path,fnmatch, HTMLParser, getopt, re +import sys,os.path,fnmatch, HTMLParser, getopt, re, codecs class HTMLFilter(HTMLParser.HTMLParser): @@ -213,11 +213,11 @@ class LinkFixer: def fix(self, path, target): self._files += 1 - data = file(path).read() + data = codecs.open(path, "r", "utf-8").read() filt = LinkFixer.LinkFilter(self._index, target, "../" * (len(os.path.split(path)[0].split("/"))), - file(path,"w")) + codecs.open(path, "w", "utf-8") ) filt.feed(data) filt.close() found, fixed, removed = filt.stats()