sqlmapproject/sqlmap · error · SqlmapValueException
unknown encoding
Error message
unknown encoding '%s'
What it means
Validation guard in _cleanupOptions: codecs.lookup() raised LookupError for the value supplied via --encoding, meaning it is not a codec name recognized by the Python runtime (e.g. a typo like 'utf8 ' or 'utf-16le ' with stray characters).
Solutions
- Supply a valid Python codec name, e.g. utf-8, cp1251, latin-1
- Check available codecs with python -c "import codecs; print(sorted(set(alternative_encodings for aliases,alternative_encodings in codecs.encodings_map.items())))" or the codecs module docs
- Remove the --encoding option to use the default encoding detection
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/core/option.py:1827 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26).
Data as JSON: /api/errors/8cabe6cdb60338cf.
Report an issue: GitHub.
Appendix: source
Thrown at lib/core/option.py:1827
errMsg += "temporary directory location ('%s')" % getSafeExString(ex)
raise SqlmapSystemException(errMsg)
conf.tempDirs.append(tempfile.tempdir)
if six.PY3:
_pympTempLeakPatch(kb.tempDir)
def _cleanupOptions():
"""
Cleanup configuration attributes.
"""
if conf.encoding:
try:
codecs.lookup(conf.encoding)
except LookupError:
errMsg = "unknown encoding '%s'" % conf.encoding
raise SqlmapValueException(errMsg)
debugMsg = "cleaning up configuration parameters"
logger.debug(debugMsg)
width = getConsoleWidth()
if conf.eta:
conf.progressWidth = width - 26
else:
conf.progressWidth = width - 46
for key, value in conf.items():
if value and any(key.endswith(_) for _ in ("Path", "File", "Dir")):
if isinstance(value, str):
conf[key] = safeExpandUser(value)
if conf.testParameter:
conf.testParameter = urldecode(conf.testParameter)View on GitHub (pinned to 0a35b20e39)