11# ------------------------------------------------------------------------------
2- # Copyright (c) 2020, 2022 , Oracle and/or its affiliates.
2+ # Copyright (c) 2020, 2024 , Oracle and/or its affiliates.
33#
44# This software is dual-licensed to you under the Universal Permissive License
55# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -261,7 +261,8 @@ cdef object _convert_to_python(ThickConnImpl conn_impl, DbType dbtype,
261261 ThickDbObjectTypeImpl obj_type_impl,
262262 dpiDataBuffer * dbvalue,
263263 int preferred_num_type = NUM_TYPE_FLOAT,
264- bint bypass_decode = False ):
264+ bint bypass_decode = False ,
265+ const char * encoding_errors = NULL ):
265266 cdef:
266267 uint32_t oracle_type = dbtype.num
267268 ThickDbObjectImpl obj_impl
@@ -282,7 +283,7 @@ cdef object _convert_to_python(ThickConnImpl conn_impl, DbType dbtype,
282283 or oracle_type == DPI_ORACLE_TYPE_LONG_NVARCHAR \
283284 or oracle_type == DPI_ORACLE_TYPE_XMLTYPE:
284285 as_bytes = & dbvalue.asBytes
285- return as_bytes.ptr[:as_bytes.length].decode()
286+ return as_bytes.ptr[:as_bytes.length].decode(" utf-8 " , encoding_errors )
286287 elif oracle_type == DPI_ORACLE_TYPE_NUMBER:
287288 as_bytes = & dbvalue.asBytes
288289 if preferred_num_type == NUM_TYPE_INT \
0 commit comments