We are getting trouble when reading the data like ("â¦", "dóñez", etc) from a data file and storing into oracle DB, these are special characters and they must read and write into database as they are.
These following areas where we are getting the problems:
1) when we use split() function, theses characters are converted into like ['\xc3\xa2\xc2\xa6', 'd\xc3\xb3\xc3\xb1ez']
2) when I call database cursor execute for insert by using same data, the data inserted as "d����ez".

But when I directly used insert/update statement from SQL developer tool, the data correctly insterted/updated as we expected, but with python only we are getting the problems. What is the fix needed here, pelase advice

'd\xc3\xb3\xc3\xb1ez

What kind of encoding you are using, utf8, it would seem:

>>> print 'd\xc3\xb3\xc3\xb1ez'.decode('utf8')
dóñez
>>> 

When I use the above decode function, I got the following result which is not accepted. Please more clues

dóñez

Probably I didn't asked properly, here is my question straightly
I need to read a text of non-ascii (ex:- dóñez) and store them into database. But my app is storing as d??ez in database, how can I save as the data is?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.