# 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):
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()
(opts, args) = getopt.getopt(sys.argv[1:], "vs:")
if len(args) != 2:
- sys.stderr.write("""Usage:
- fix-links.py [-s skip-dir]... <errrorX.txt> <errorAX.txt>
+ sys.stderr.write("""Usage: fix-links.py [-s skip-dir]... <errrorX.txt> <errorAX.txt>
Process the 'errorX.txt' and 'errorAX.txt' files as generated by
'linklint': Check all invalid links and try to find the correct