diff --git a/ChangeLog b/ChangeLog index d947e0c1..19f06dce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,16 @@ Type: bugfix Changed: linkcheck/configuration.py + * The default output encoding is now that of your locale, and not + the hardcoded iso-8859-15 anymore. + Type: feature + Changed: linkcheck/logger/__init__.py + + * Do not generate an empty user config dir ~/.linkchecker by default, + only when needed. + Type: feature + Changed: linkchecker + * Redundant dot path at beginning of relative urls are now removed. Type: feature Changed: linkcheck/url.py, linkcheck/tests/test_url.py diff --git a/doc/en/linkchecker.1 b/doc/en/linkchecker.1 index 8b688016..c6892ea9 100644 --- a/doc/en/linkchecker.1 +++ b/doc/en/linkchecker.1 @@ -112,18 +112,18 @@ Specify output type as \fBtext\fP, \fBhtml\fP, \fBsql\fP, Default type is \fBtext\fP. The various output types are documented below. \fIencoding\fP specifies the output encoding, the default is -\fBiso\-8859\-15\fP. +that of your locale. Valid encodings are listed at -\fBhttp://docs.python.org/lib/node127.html\fP. +\fBhttp://docs.python.org/lib/standard-encodings.html\fP. .TP \fB\-F\fP\fItype\fP[\fB/\fP\fIencoding\fP][\fB/\fP\fIfilename\fP], \fB\-\-file\-output=\fP\fItype\fP[\fB/\fP\fIencoding\fP][\fB/\fP\fIfilename\fP] Output to a file \fBlinkchecker\-out.\fP\fItype\fP, \fB$HOME/.linkchecker/blacklist\fP for \fBblacklist\fP output, or \fIfilename\fP if specified. \fIencoding\fP specifies the output encoding, the default is -\fBiso\-8859\-15\fP. +that of your locale. Valid encodings are listed at -\fBhttp://docs.python.org/lib/node127.html\fP. +\fBhttp://docs.python.org/lib/standard-encodings.html\fP. The \fIfilename\fP part of the \fBnone\fP output type will be ignored, else if the file already exists, it will be overwritten. You can specify this option more than once. Valid file output types @@ -319,7 +319,7 @@ configuration files \fBlinkchecker\-out.\fP\fItype\fP - default logger file output name -\fBhttp://docs.python.org/lib/node127.html\fP - valid output encodings +\fBhttp://docs.python.org/lib/standard-encodings.html\fP - valid output encodings .SH AUTHOR Bastian Kleineidam diff --git a/linkcheck/logger/__init__.py b/linkcheck/logger/__init__.py index 097a02f9..61153769 100644 --- a/linkcheck/logger/__init__.py +++ b/linkcheck/logger/__init__.py @@ -18,6 +18,7 @@ Output logging support for different formats. """ +import locale import sys import os import os.path @@ -69,7 +70,7 @@ class Logger (object): # number of encountered warningss self.warnings = 0 # encoding of output - self.output_encoding = args.get("encoding", "iso-8859-1") + self.output_encoding = args.get("encoding", locale.getpreferredencoding()) def init_fileoutput (self, args): """