Hi,
I am new to python. I am using python 2.6.6 with pyodbc-2.1.8 and pywin32-216 on Windows Vista.
I was able to connect to MS Access with pyodbc and execute my SELECT statement to retrieve data from MS Access. However, what I have retrieved appeared to be in Unicode strings (e.g., u'xyz', etc.) which I could not use as keys to build a dictionary, and I could not use as strings to write regular expressions to match with certain patterns.
I have tried using Unicode encoding like s.decode(encodi ng, [,error]) with default encoding (ASCII), and 'utf-8', and 'ignore' invalid characters for error flag, but could not get that to work.
Are there any ways to convert the unicode string so that I can use it as key to build dictionary and use for regular expresssion matching? Some examples would be highly appreciated.
Thank you in advance for your help!
I am new to python. I am using python 2.6.6 with pyodbc-2.1.8 and pywin32-216 on Windows Vista.
I was able to connect to MS Access with pyodbc and execute my SELECT statement to retrieve data from MS Access. However, what I have retrieved appeared to be in Unicode strings (e.g., u'xyz', etc.) which I could not use as keys to build a dictionary, and I could not use as strings to write regular expressions to match with certain patterns.
I have tried using Unicode encoding like s.decode(encodi ng, [,error]) with default encoding (ASCII), and 'utf-8', and 'ignore' invalid characters for error flag, but could not get that to work.
Are there any ways to convert the unicode string so that I can use it as key to build dictionary and use for regular expresssion matching? Some examples would be highly appreciated.
Thank you in advance for your help!
Comment