@@ -3171,9 +3171,9 @@ def test_gbk_encoding_chinese_simplified(db_connection):
31713171 cursor .execute ("INSERT INTO #test_gbk VALUES (?, ?)" , 1 , chinese_text )
31723172 cursor .execute ("SELECT data FROM #test_gbk WHERE id = 1" )
31733173 result = cursor .fetchone ()
3174- print (f" Testing { chinese_text !r } ({ meaning } ): { safe_display (result [0 ])} " )
3174+ print (f" Testing { ascii ( chinese_text ) } ({ meaning } ): { safe_display (result [0 ])} " )
31753175 else :
3176- print (f" Skipping { chinese_text !r } (not GBK compatible)" )
3176+ print (f" Skipping { ascii ( chinese_text ) } (not GBK compatible)" )
31773177
31783178 print ("=" * 60 )
31793179
@@ -3205,9 +3205,9 @@ def test_big5_encoding_chinese_traditional(db_connection):
32053205 cursor .execute ("INSERT INTO #test_big5 VALUES (?, ?)" , 1 , chinese_text )
32063206 cursor .execute ("SELECT data FROM #test_big5 WHERE id = 1" )
32073207 result = cursor .fetchone ()
3208- print (f" Testing { chinese_text !r } ({ meaning } ): { safe_display (result [0 ])} " )
3208+ print (f" Testing { ascii ( chinese_text ) } ({ meaning } ): { safe_display (result [0 ])} " )
32093209 else :
3210- print (f" Skipping { chinese_text !r } (not Big5 compatible)" )
3210+ print (f" Skipping { ascii ( chinese_text ) } (not Big5 compatible)" )
32113211
32123212 print ("=" * 60 )
32133213
@@ -3239,9 +3239,9 @@ def test_shift_jis_encoding_japanese(db_connection):
32393239 cursor .execute ("INSERT INTO #test_sjis VALUES (?, ?)" , 1 , japanese_text )
32403240 cursor .execute ("SELECT data FROM #test_sjis WHERE id = 1" )
32413241 result = cursor .fetchone ()
3242- print (f" Testing { japanese_text !r } ({ meaning } ): { safe_display (result [0 ])} " )
3242+ print (f" Testing { ascii ( japanese_text ) } ({ meaning } ): { safe_display (result [0 ])} " )
32433243 else :
3244- print (f" Skipping { japanese_text !r } (not Shift-JIS compatible)" )
3244+ print (f" Skipping { ascii ( japanese_text ) } (not Shift-JIS compatible)" )
32453245
32463246 print ("=" * 60 )
32473247
@@ -3274,9 +3274,9 @@ def test_euc_kr_encoding_korean(db_connection):
32743274 cursor .execute ("INSERT INTO #test_euckr VALUES (?, ?)" , 1 , korean_text )
32753275 cursor .execute ("SELECT data FROM #test_euckr WHERE id = 1" )
32763276 result = cursor .fetchone ()
3277- print (f" Testing { korean_text !r } ({ meaning } ): { safe_display (result [0 ])} " )
3277+ print (f" Testing { ascii ( korean_text ) } ({ meaning } ): { safe_display (result [0 ])} " )
32783278 else :
3279- print (f" Skipping { korean_text !r } (not EUC-KR compatible)" )
3279+ print (f" Skipping { ascii ( korean_text ) } (not EUC-KR compatible)" )
32803280
32813281 print ("=" * 60 )
32823282
@@ -3317,7 +3317,7 @@ def test_latin1_encoding_western_european(db_connection):
33173317 cursor .execute ("SELECT data FROM #test_latin1 WHERE id = 1" )
33183318 result = cursor .fetchone ()
33193319 match = "PASS" if result [0 ] == text else "FAIL"
3320- print (f" { match } { description :15} | { text !r } -> { result [0 ]!r } " )
3320+ print (f" { match } { description :15} | { ascii ( text ) } -> { ascii ( result [0 ]) } " )
33213321 else :
33223322 print (f" SKIP { description :15} | Not Latin-1 compatible" )
33233323
@@ -3355,7 +3355,7 @@ def test_cp1252_encoding_windows_western(db_connection):
33553355 cursor .execute ("SELECT data FROM #test_cp1252 WHERE id = 1" )
33563356 result = cursor .fetchone ()
33573357 match = "PASS" if result [0 ] == text else "FAIL"
3358- print (f" { match } { description :15} | { text !r } -> { result [0 ]!r } " )
3358+ print (f" { match } { description :15} | { ascii ( text ) } -> { ascii ( result [0 ]) } " )
33593359 else :
33603360 print (f" SKIP { description :15} | Not CP1252 compatible" )
33613361
0 commit comments