mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed encoding issue when database encoding set to SQL_ASCII and name of the column is in ASCII character. Fixes #6018
This commit is contained in:
committed by
Akshay Joshi
parent
5a5a9314f3
commit
87b9549ff4
@@ -453,7 +453,9 @@ def poll(trans_id):
|
||||
# Using characters %, (, ) in the argument names is not
|
||||
# supported in psycopg2
|
||||
col_info['pgadmin_alias'] = \
|
||||
re.sub("[%()]+", "|", col_name)
|
||||
re.sub("[%()]+", "|", col_name).\
|
||||
encode('unicode_escape').decode('utf-8')
|
||||
|
||||
session_obj['columns_info'] = columns
|
||||
|
||||
# status of async_fetchmany_2darray is True and result is none
|
||||
|
||||
@@ -45,6 +45,13 @@ class TestEncodingCharset(BaseTestGenerator):
|
||||
lc_collate='C',
|
||||
test_str='Tif'
|
||||
)),
|
||||
(
|
||||
'With Encoding SQL_ASCII (additional test)',
|
||||
dict(
|
||||
db_encoding='SQL_ASCII',
|
||||
lc_collate='C',
|
||||
test_str='ü'
|
||||
)),
|
||||
(
|
||||
'With Encoding LATIN1',
|
||||
dict(
|
||||
|
||||
@@ -55,6 +55,14 @@ class TestSQLASCIIEncoding(BaseTestGenerator):
|
||||
lc_collate='C',
|
||||
test_str='Blob: \xf4\xa5\xa3\xa5'
|
||||
)),
|
||||
(
|
||||
'Test SQL_ASCII data with blob string & ascii table name',
|
||||
dict(
|
||||
table_name='ü',
|
||||
db_encoding='SQL_ASCII',
|
||||
lc_collate='C',
|
||||
test_str='Blob: \xf4\xa5\xa3\xa5'
|
||||
)),
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user