@@ -267,11 +267,6 @@ PyObject* _pysqlite_build_column_name(const char* colname)
267267 }
268268}
269269
270- PyObject * pysqlite_unicode_from_string (const char * val_str , Py_ssize_t size , int optimize )
271- {
272- return PyUnicode_FromStringAndSize (val_str , size );
273- }
274-
275270/*
276271 * Returns a row from the currently active SQLite statement
277272 *
@@ -355,12 +350,8 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
355350 } else if (coltype == SQLITE_TEXT ) {
356351 val_str = (const char * )sqlite3_column_text (self -> statement -> st , i );
357352 nbytes = sqlite3_column_bytes (self -> statement -> st , i );
358- if ((self -> connection -> text_factory == (PyObject * )& PyUnicode_Type )
359- || (self -> connection -> text_factory == pysqlite_OptimizedUnicode )) {
360-
361- converted = pysqlite_unicode_from_string (val_str , nbytes ,
362- self -> connection -> text_factory == pysqlite_OptimizedUnicode ? 1 : 0 );
363-
353+ if (self -> connection -> text_factory == (PyObject * )& PyUnicode_Type ) {
354+ converted = PyUnicode_FromStringAndSize (val_str , nbytes );
364355 if (!converted ) {
365356 colname = sqlite3_column_name (self -> statement -> st , i );
366357 if (!colname ) {
@@ -459,7 +450,6 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
459450 int statement_type ;
460451 PyObject * descriptor ;
461452 PyObject * second_argument = NULL ;
462- int allow_8bit_chars ;
463453
464454 if (!check_cursor (self )) {
465455 goto error ;
@@ -468,10 +458,6 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
468458 self -> locked = 1 ;
469459 self -> reset = 0 ;
470460
471- /* Make shooting yourself in the foot with not utf-8 decodable 8-bit-strings harder */
472- allow_8bit_chars = ((self -> connection -> text_factory != (PyObject * )& PyUnicode_Type ) &&
473- (self -> connection -> text_factory != pysqlite_OptimizedUnicode ));
474-
475461 Py_XDECREF (self -> next_row );
476462 self -> next_row = NULL ;
477463
@@ -630,7 +616,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
630616
631617 pysqlite_statement_mark_dirty (self -> statement );
632618
633- pysqlite_statement_bind_parameters (self -> statement , parameters , allow_8bit_chars );
619+ pysqlite_statement_bind_parameters (self -> statement , parameters );
634620 if (PyErr_Occurred ()) {
635621 goto error ;
636622 }
0 commit comments