MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / getText

Function getText

lib/core/convert.py:383–404  ·  view source on GitHub ↗

Returns textual value of a given value (Note: not necessary Unicode on Python2) >>> getText(b"foobar") 'foobar' >>> isinstance(getText(u"fo\\u2299bar"), six.text_type) True

(value, encoding=None)

Source from the content-addressed store, hash-verified

381 return six.text_type(str(value), errors="ignore") # encoding ignored for non-basestring instances
382
383def getText(value, encoding=None):
384 """
385 Returns textual value of a given value (Note: not necessary Unicode on Python2)
386
387 >>> getText(b"foobar")
388 'foobar'
389 >>> isinstance(getText(u"fo\\u2299bar"), six.text_type)
390 True
391 """
392
393 retVal = value
394
395 if isinstance(value, six.binary_type):
396 retVal = getUnicode(value, encoding)
397
398 if six.PY2:
399 try:
400 retVal = str(retVal)
401 except:
402 pass
403
404 return retVal
405
406def stdoutEncode(value):
407 """

Callers 15

apache_sha1_passwdFunction · 0.90
ssha_passwdFunction · 0.90
ssha256_passwdFunction · 0.90
ssha512_passwdFunction · 0.90
crypt_generic_passwdFunction · 0.90
unix_md5_passwdFunction · 0.90
_clientFunction · 0.90
toDictMethod · 0.90
parseMethod · 0.90
toDictMethod · 0.90
getPageMethod · 0.90
decodePageFunction · 0.90

Calls 1

getUnicodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…