added --charset option to force charset encoding of the retrieved data (e.g. when the backend collation is different than the current web page charset) as requested by devon.mitchell1988@y​ahoo.com

This commit is contained in:
Miroslav Stampar
2011-05-17 22:55:22 +00:00
parent dfe81cc66f
commit cc07e5dc97
5 changed files with 60 additions and 40 deletions

View File

@@ -1636,6 +1636,15 @@ def __basicOptionValidation():
errMsg = "value for --union-cols must be a range with hyphon (e.g. 1-10)"
raise sqlmapSyntaxException, errMsg
if conf.charset:
try:
codecs.lookup(conf.charset)
except LookupError:
errMsg = "unknown charset '%s'. please visit page " % conf.charset
errMsg += "'http://docs.python.org/library/codecs.html#standard-encodings' "
errMsg += "to get the full list of supported charsets"
raise sqlmapSyntaxException, errMsg
def init(inputOptions=advancedDict(), overrideOptions=False):
"""
Set attributes into both configuration and knowledge base singletons