python-cx_Oracle icon indicating copy to clipboard operation
python-cx_Oracle copied to clipboard

Cursor.description internal_size=4 against db charset WE8DEC/JA16EUC/ZHS16GBK

Open zhua03 opened this issue 5 years ago • 0 comments

  1. What versions are you using?

DB version 19.8.0.0.0 , with db charset WE8DEC/JA16EUC/ZHS16GBK cx_Oracle.version: 8.0.1 cx_Oracle.clientversion: (19, 8, 0, 0, 0)

  1. Describe the problem

internal_size, the Cursor.description contains information about column, is 4 against Db charset WE8DEC (max byte length is 1 )/JA16EUC (max byte length is 3)/ ZHS16GBK (max byte length is 2) But the value is correct against db charset AL32UTF8, i.e, for US char internal_size=1, European char internal_size=2, S-Chinese char internal_size=3, Supplementary char internal_size=4.

  1. Include a runnable Python script that shows the problem.

import cx_Oracle

conn = cx_Oracle.connect(...) cursor = conn.cursor() cursor.execute("select 'X' from dual") col, = cursor.description value = col[3] print('internal_size is', value)

zhua03 avatar Feb 06 '21 11:02 zhua03