mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 00:04:23 +03:00
Patch for an Issue #978
This commit is contained in:
parent
ab49fe6a39
commit
56b6bf72f4
|
@ -2068,7 +2068,10 @@ def getUnicode(value, encoding=None, noneToNull=False):
|
||||||
try:
|
try:
|
||||||
return unicode(value, encoding or kb.get("pageEncoding") or UNICODE_ENCODING)
|
return unicode(value, encoding or kb.get("pageEncoding") or UNICODE_ENCODING)
|
||||||
except UnicodeDecodeError, ex:
|
except UnicodeDecodeError, ex:
|
||||||
value = value[:ex.start] + "".join(INVALID_UNICODE_CHAR_FORMAT % ord(_) for _ in value[ex.start:ex.end]) + value[ex.end:]
|
try:
|
||||||
|
return unicode(value, UNICODE_ENCODING)
|
||||||
|
except:
|
||||||
|
value = value[:ex.start] + "".join(INVALID_UNICODE_CHAR_FORMAT % ord(_) for _ in value[ex.start:ex.end]) + value[ex.end:]
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
return unicode(value)
|
return unicode(value)
|
||||||
|
|
|
@ -145,17 +145,21 @@ def htmlunescape(value):
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
def singleTimeWarnMessage(message): # Cross-linked function
|
def singleTimeWarnMessage(message): # Cross-linked function
|
||||||
raise NotImplementedError
|
sys.stdout.write(message)
|
||||||
|
sys.stdout.write("\n")
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
def stdoutencode(data):
|
def stdoutencode(data):
|
||||||
retVal = None
|
retVal = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
data = data or ""
|
||||||
|
|
||||||
# Reference: http://bugs.python.org/issue1602
|
# Reference: http://bugs.python.org/issue1602
|
||||||
if IS_WIN:
|
if IS_WIN:
|
||||||
output = data.encode("ascii", "replace")
|
output = data.encode(sys.stdout.encoding, "replace")
|
||||||
|
|
||||||
if output != data:
|
if '?' in output:
|
||||||
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 "
|
||||||
|
|
|
@ -791,7 +791,7 @@ def cmdLineParser():
|
||||||
advancedHelp = True
|
advancedHelp = True
|
||||||
|
|
||||||
for arg in sys.argv:
|
for arg in sys.argv:
|
||||||
argv.append(getUnicode(arg, encoding=sys.stdin.encoding))
|
argv.append(getUnicode(arg, encoding=sys.getfilesystemencoding()))
|
||||||
|
|
||||||
checkDeprecatedOptions(argv)
|
checkDeprecatedOptions(argv)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user