@@ -169,6 +169,22 @@ def testNCLOBsDirect(self):
169
169
"test binding and fetching NCLOB data (directly)"
170
170
self .__PerformTest ("NCLOB" , cx_Oracle .NCLOB )
171
171
172
+ def testNCLOBDifferentEncodings (self ):
173
+ "test binding and fetching NCLOB data (different encodings)"
174
+ connection = cx_Oracle .connect (USERNAME , PASSWORD , TNSENTRY ,
175
+ encoding = "UTF-8" , nencoding = "UTF-16" )
176
+ value = u"\u03b4 \u4e2a "
177
+ cursor = connection .cursor ()
178
+ cursor .execute ("truncate table TestNCLOBs" )
179
+ cursor .execute ("insert into TestNCLOBs values (1, :val)" , val = value )
180
+ cursor .execute ("select NCLOBCol from TestNCLOBs" )
181
+ nclob , = cursor .fetchone ()
182
+ cursor .execute ("update TestNCLOBs set NCLOBCol = :val" ,
183
+ val = nclob .read () + value )
184
+ cursor .execute ("select NCLOBCol from TestNCLOBs" )
185
+ nclob , = cursor .fetchone ()
186
+ self .assertEqual (nclob .read (), value + value )
187
+
172
188
def testNCLOBsIndirect (self ):
173
189
"test binding and fetching NCLOB data (indirectly)"
174
190
self .__PerformTest ("NCLOB" , cx_Oracle .LONG_STRING )
0 commit comments