mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-02 11:54:43 +00:00
Use i18n.default_encoding instead of a hardcoded one of iso-8859-1.
This commit is contained in:
parent
70e0814952
commit
153c241049
1 changed files with 3 additions and 2 deletions
|
|
@ -31,9 +31,10 @@ import math
|
|||
import time
|
||||
import urlparse
|
||||
import pydoc
|
||||
from . import i18n
|
||||
|
||||
|
||||
def unicode_safe (s, encoding="iso-8859-1"):
|
||||
def unicode_safe (s):
|
||||
"""Get unicode string without raising encoding errors. Unknown
|
||||
characters of the given encoding will be ignored.
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ def unicode_safe (s, encoding="iso-8859-1"):
|
|||
if isinstance(s, unicode):
|
||||
# s is already unicode, nothing to do
|
||||
return s
|
||||
return unicode(str(s), encoding, "ignore")
|
||||
return unicode(str(s), i18n.default_encoding, "ignore")
|
||||
|
||||
|
||||
def ascii_safe (s):
|
||||
|
|
|
|||
Loading…
Reference in a new issue