Re: [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character

From: Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>
To: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character
Date: 2016-07-12 10:28:13
Message-ID: CAKKotZT1YL55ef4rOHJZdX8MuEceEU4RZko0F1CYzL+mKgQDjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

May be because of Python2.7 but if you try in Python3. It works.

we can use PEP 0263 <http://www.python.org/dev/peps/pep-0263/> to fix this
issue. // # -*- coding: utf-8 -*-

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Tue, Jul 12, 2016 at 3:48 PM, Surinder Kumar <
surinder(dot)kumar(at)enterprisedb(dot)com> wrote:

> On Tue, Jul 12, 2016 at 3:43 PM, Murtuza Zabuawala <
> murtuza(dot)zabuawala(at)enterprisedb(dot)com> wrote:
>
>> Hi,
>>
>> Just a heads up, This issue is occurs only in runtime & If you try in web
>> everything works fine when you provide unicode characters as object name.
>>
> No, this issue is reported for both web and runtime application. It is
> reproducible to me in web application.
>
>>
>> Now sure but the issue is when runtime(QtWebkit) sends data it does not
>> encodes it properly & this should be generic fix in runtime.
>>
>> Regards,
>> Murtuza
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Tue, Jul 12, 2016 at 3:27 PM, Surinder Kumar <
>> surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
>>
>>> Hi
>>>
>>> *What is happening in code?*
>>> Database is created with Chinese characters successfully with ascii
>>> values(Chinese characters converted to ascii) before saving internally.
>>>
>>> but when database properties is retrieved by name, it fails to fetch
>>> data and throws UnicodeError.
>>>
>>> *Solution:*
>>> Database name should be encoded in 'utf-8' before storing to database.
>>> This resolved the issue.
>>> I have tested this patch by creating database name using Japanese and
>>> Chinese characters. It works.
>>>
>>> Also referenced the code to *set default encoding to 'uff-8' *before
>>> start of application.
>>> https://github.com/joeyespo/grip/issues/86
>>>
>>> @Ashesh/@Dave can you please review the patch?
>>> If it looks good, we can do the same changes in case of other nodes.
>>>
>>> Thanks,
>>> Surinder Kumar
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers(at)postgresql(dot)org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>
>>>
>>
>

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Ashesh Vashi 2016-07-12 10:37:21 Re: [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character
Previous Message Surinder Kumar 2016-07-12 10:27:19 Re: [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character