Home > other >  A garbled python3 access oracle
A garbled python3 access oracle

Time:11-25

Use cx_oracle python3, access oracle database and environmental GBK code is
Most of the data is no problem, there are a few data is a problem left over by history, address what had the code inside,
So when fetchone complains, what's the solution?
Similar code is no problem, when python2 migrated to that there was such a big pit in python3 is really quite speechless,

CodePudding user response:

See if what's error message, quotes or \ characters, if it is, can consider to select the address field, use the replace directly eliminate the two symbols,


In addition, can consider to do the data cleaning, the historical data to make a deal with, total and

CodePudding user response:

reference 1/f, old coconut response:
to see what the error message is, is it quotes or \ characters, if it is, can consider to select the address field, use the replace directly eliminate the two symbols,


In addition, can consider to do the data cleaning, the historical data to make a deal with, total and


不是引号也不是什么特殊符号,就是极少数数据有乱码,比如"???????? "In this way,
Data is too important, and wrong is more, can't change, and even changed the future is likely to have a new the garbled,
Python3 this kind of trouble, really similar things also a GBK text files, for example, needs to read come in to do some processing, but there are a few lines are garbled, will go wrong, when I was read by binary read in, deal with the time and trouble,

CodePudding user response:

Try less than 32 ASCII code, replace with entirely empty,
  • Related