File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626from lib .core .common import dataToSessionFile
2727from lib .core .convert import base64pickle
2828from lib .core .convert import base64unpickle
29+ from lib .core .convert import utf8decode
2930from lib .core .data import conf
3031from lib .core .data import kb
3132from lib .core .data import logger
@@ -67,7 +68,10 @@ def direct(query, content=True):
6768
6869 if len (output ) == 1 :
6970 if len (output [0 ]) == 1 :
70- return unicode (list (output )[0 ][0 ])
71+ out = list (output )[0 ][0 ]
72+ if isinstance (out , str ):
73+ out = utf8decode (out )
74+ return out
7175 else :
7276 return list (output )
7377 else :
Original file line number Diff line number Diff line change 2424
2525try :
2626 import psycopg2
27+ import psycopg2 .extensions
28+ psycopg2 .extensions .register_type (psycopg2 .extensions .UNICODE )
29+ psycopg2 .extensions .register_type (psycopg2 .extensions .UNICODEARRAY )
2730except ImportError , _ :
2831 pass
2932
@@ -54,6 +57,8 @@ def connect(self):
5457 except psycopg2 .OperationalError , msg :
5558 raise sqlmapConnectionException , msg
5659
60+ self .connector .set_client_encoding ('UNICODE' )
61+
5762 self .setCursor ()
5863 self .connected ()
5964
You can’t perform that action at this time.
0 commit comments