mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-10-12 02:22:55 +00:00
Fixes diplaying of non-ASCII chars on Windows OS
This commit is contained in:
+8
-1
@@ -637,7 +637,14 @@ def stdoutEncode(value):
|
|||||||
|
|
||||||
kb.codePage = kb.codePage or ""
|
kb.codePage = kb.codePage or ""
|
||||||
|
|
||||||
encoding = kb.get("codePage") or getattr(sys.stdout, "encoding", None) or UNICODE_ENCODING
|
# Python 3.6+ writes to the Windows console via WriteConsoleW (PEP 528), so sys.stdout.encoding
|
||||||
|
# (typically 'utf-8') renders Unicode that the legacy OEM/ANSI code page from 'chcp' would replace
|
||||||
|
# with '?'; prefer it there. The chcp-derived code page stays as the fallback (older interpreters,
|
||||||
|
# PYTHONLEGACYWINDOWSSTDIO, or a console encoding Python could not determine) and for Python 2.
|
||||||
|
if six.PY3:
|
||||||
|
encoding = getattr(sys.stdout, "encoding", None) or kb.get("codePage") or UNICODE_ENCODING
|
||||||
|
else:
|
||||||
|
encoding = kb.get("codePage") or getattr(sys.stdout, "encoding", None) or UNICODE_ENCODING
|
||||||
|
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
if isinstance(value, (bytes, bytearray)):
|
if isinstance(value, (bytes, bytearray)):
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ from lib.core.enums import OS
|
|||||||
from thirdparty import six
|
from thirdparty import six
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.10.7.251"
|
VERSION = "1.10.7.252"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|||||||
Reference in New Issue
Block a user