sqlmapproject/sqlmap · error · SqlmapSyntaxException

unknown encoding ' '. Please visit ' ' to get the full list…

Error message

unknown encoding '%s'. Please visit '%s' to get the full list of supported encodings

What it means

Startup value-validation guard in _basicOptionValidation: the encoding from --encoding (conf.encoding) is validated with codecs.lookup; a LookupError there means the name is not a codec Python recognizes, and the message embeds both the given value and the URL where supported codec names are listed.

Solutions

  1. Use a canonical codec name, e.g. --encoding=utf-8 or --encoding=gbk
  2. Run python -c "import codecs; codecs.lookup('NAME')" to verify the codec exists
  3. Remove --encoding to let sqlmap auto-detect the encoding
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/core/option.py:3106 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/afbd51dd96939bda. Report an issue: GitHub.

Appendix: source

Thrown at lib/core/option.py:3106

    if isinstance(conf.uCols, six.string_types):
        if not conf.uCols.isdigit() and ("-" not in conf.uCols or len(conf.uCols.split("-")) != 2):
            errMsg = "value for option '--union-cols' must be a range with hyphon "
            errMsg += "(e.g. 1-10) or integer value (e.g. 5)"
            raise SqlmapSyntaxException(errMsg)

    if conf.dbmsCred and ':' not in conf.dbmsCred:
        errMsg = "value for option '--dbms-cred' must be in "
        errMsg += "format <username>:<password> (e.g. \"root:pass\")"
        raise SqlmapSyntaxException(errMsg)

    if conf.encoding:
        _ = checkCharEncoding(conf.encoding, False)
        if _ is None:
            errMsg = "unknown encoding '%s'. Please visit " % conf.encoding
            errMsg += "'%s' to get the full list of " % CODECS_LIST_PAGE
            errMsg += "supported encodings"
            raise SqlmapSyntaxException(errMsg)
        else:
            conf.encoding = _

    if conf.fileWrite and not os.path.isfile(conf.fileWrite):
        errMsg = "file '%s' does not exist" % os.path.abspath(conf.fileWrite)
        raise SqlmapFilePathException(errMsg)

    if conf.loadCookies and not os.path.exists(conf.loadCookies):
        errMsg = "cookies file '%s' does not exist" % os.path.abspath(conf.loadCookies)
        raise SqlmapFilePathException(errMsg)

def initOptions(inputOptions=AttribDict(), overrideOptions=False):
    _setConfAttributes()
    _setKnowledgeBaseAttributes()
    _mergeOptions(inputOptions, overrideOptions)

def init():
    """

View on GitHub (pinned to 0a35b20e39)