mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-29 13:03:50 +03:00
minor improvement
This commit is contained in:
parent
3484a4426b
commit
c3bb5a03e1
|
@ -653,7 +653,7 @@ def dataToStdout(data, forceOutput=False):
|
||||||
warnMsg = "cannot properly display Unicode characters "
|
warnMsg = "cannot properly display Unicode characters "
|
||||||
warnMsg += "inside Windows OS command prompt "
|
warnMsg += "inside Windows OS command prompt "
|
||||||
warnMsg += "(http://bugs.python.org/issue1602). All "
|
warnMsg += "(http://bugs.python.org/issue1602). All "
|
||||||
warnMsg += "similar occurances will result in "
|
warnMsg += "unhandled occurances will result in "
|
||||||
warnMsg += "replacement with '?' character. Please, find "
|
warnMsg += "replacement with '?' character. Please, find "
|
||||||
warnMsg += "proper character representation inside "
|
warnMsg += "proper character representation inside "
|
||||||
warnMsg += "coresponding output files. "
|
warnMsg += "coresponding output files. "
|
||||||
|
@ -1798,7 +1798,7 @@ def getUnicode(value, encoding=None, system=False):
|
||||||
if isinstance(value, unicode):
|
if isinstance(value, unicode):
|
||||||
return value
|
return value
|
||||||
elif isinstance(value, basestring):
|
elif isinstance(value, basestring):
|
||||||
return unicode(value, encoding or UNICODE_ENCODING, errors="replace")
|
return unicode(value, encoding or UNICODE_ENCODING, errors="xmlcharrefreplace")
|
||||||
else:
|
else:
|
||||||
return unicode(value) # encoding ignored for non-basestring instances
|
return unicode(value) # encoding ignored for non-basestring instances
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -85,7 +85,7 @@ def urldecode(value, encoding=None):
|
||||||
result = urllib.unquote_plus(value)
|
result = urllib.unquote_plus(value)
|
||||||
|
|
||||||
if isinstance(result, str):
|
if isinstance(result, str):
|
||||||
result = unicode(result, encoding or UNICODE_ENCODING, errors="replace")
|
result = unicode(result, encoding or UNICODE_ENCODING, errors="xmlcharrefreplace")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ def unicodeencode(value, encoding=None):
|
||||||
try:
|
try:
|
||||||
retVal = value.encode(encoding or UNICODE_ENCODING)
|
retVal = value.encode(encoding or UNICODE_ENCODING)
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
retVal = value.encode(UNICODE_ENCODING, "replace")
|
retVal = value.encode(UNICODE_ENCODING, "xmlcharrefreplace")
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
def utf8encode(value):
|
def utf8encode(value):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user