Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMv4k-0006K7-5O for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jul 2016 10:38:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bMv4j-000393-Ox for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jul 2016 10:38:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bMv4W-0002v0-Kc for pgadmin-hackers@postgresql.org; Tue, 12 Jul 2016 10:37:48 +0000 Received: from mail-it0-x232.google.com ([2607:f8b0:4001:c0b::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bMv4Q-0006Y7-Qk for pgadmin-hackers@postgresql.org; Tue, 12 Jul 2016 10:37:47 +0000 Received: by mail-it0-x232.google.com with SMTP id f6so2288314ith.0 for ; Tue, 12 Jul 2016 03:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IAGiNsjFrtIJ7Cgzb7voqQqNMNn6jsf8QXbn3+h5/kU=; b=RR14caDWLLVLbdemcjUWz4iF075CODDsC/u8grzvrkyqDbqbHhnHjDNXySTGHsxA3K zHeIh/hSuFbRebj/SYRWFOO3qzbisOuMS0qBP3EJCiTT7/m5bl/gB6IOLXHDlaMfxZLk sMmeLS0+tkStKMZZzETKw4j2PD82WW7XjCl6+oT4Avc0sRbujFXV0EXVbG/MNdm4ELoK 5aNlKwIWkp/zIwnvM8TtFpGwuy2QOa2vSbUELSSqSoVjEymOAhB8Q6EgGq9xlCkSqr0x SvPn9B46kTw1B3IalX4xNEr79o80Hiq6sjNanBLbMuJM/nfxmcDx1HU0iSYgpfpPONHw vFsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IAGiNsjFrtIJ7Cgzb7voqQqNMNn6jsf8QXbn3+h5/kU=; b=ciGGTs3P7ezkIKSAbLKrVE2A2TcFA6g2aFQ8cA0NQ3skEL6huQkazYfFw56qLHbZdi VpzFg2we6jqb7sOXTd3wyK8D+rSpXwP0wkqI3F9IjLFsUEg9DivtVjUBjJhaw42ukkri X77cSjFiplXJvYg5+HjLntxa0z5OXk85wmCjI0J4GSCPxTbb7hTghV5AKTIeV2wM15cW myy/15rJowFzeJ+qWuTV+9YvZiM7jLOl2SXngzdrG8yUVdkvPLAeC1JP061wTcJpnCXe vdZuXkayQcltpwlMYgye6FPauVEc/bRjT0f7kMJyHy/XcKKYa1K6oPUysF1cFZ1Gb5wg 30Vg== X-Gm-Message-State: ALyK8tJTaZoId127lmEuYcVyE7wLEgCOC+Xmr4tgsnP8mEveeiLjFvCgSPlFRENfoKveQ0pTzxWZwx70mG4RxsM2 X-Received: by 10.36.138.65 with SMTP id v62mr14521119itd.51.1468319860898; Tue, 12 Jul 2016 03:37:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.133.217 with HTTP; Tue, 12 Jul 2016 03:37:21 -0700 (PDT) In-Reply-To: References: From: Ashesh Vashi Date: Tue, 12 Jul 2016 16:07:21 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character To: Murtuza Zabuawala Cc: Surinder Kumar , pgadmin-hackers Content-Type: multipart/alternative; boundary=94eb2c08eeb0b9ebb305376ddbf5 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --94eb2c08eeb0b9ebb305376ddbf5 Content-Type: text/plain; charset=UTF-8 On Tue, Jul 12, 2016 at 3:58 PM, Murtuza Zabuawala < murtuza.zabuawala@enterprisedb.com> wrote: > May be because of Python2.7 but if you try in Python3. It works. > > we can use PEP 0263 to fix > this issue. // # -*- coding: utf-8 -*- > Isn't this about the source code encoding, and not about the input encoding? -- Thanks & Regards, Ashesh Vashi EnterpriseDB INDIA: Enterprise PostgreSQL Company *http://www.linkedin.com/in/asheshvashi* > > > -- > Regards, > Murtuza Zabuawala > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > On Tue, Jul 12, 2016 at 3:48 PM, Surinder Kumar < > surinder.kumar@enterprisedb.com> wrote: > >> On Tue, Jul 12, 2016 at 3:43 PM, Murtuza Zabuawala < >> murtuza.zabuawala@enterprisedb.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.kumar@enterprisedb.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@postgresql.org) >>>> To make changes to your subscription: >>>> http://www.postgresql.org/mailpref/pgadmin-hackers >>>> >>>> >>> >> > --94eb2c08eeb0b9ebb305376ddbf5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Tue, Jul 12, 2016 at 3:58 PM, Mu= rtuza Zabuawala <murtuza.zabuawala@enterprisedb.com&g= t; wrote:

=
May be because of Python2.7 but if y= ou try in Python3. It works.

we can use=C2=A0<= a href=3D"http://www.python.org/dev/peps/pep-0263/" style=3D"margin:0px;pad= ding:0px;border:0px;font-size:15px;color:rgb(0,89,153);text-decoration:none= ;font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-hei= ght:19.5px" target=3D"_blank">PEP 0263=C2=A0to fix this issue. =C2=A0//= # -*- coding: utf-8 -*-
Isn't this about = the source code encoding, and not about the input encoding?

<= /div>

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA:=C2=A0Enterprise PostgreSQL Company=




--
Regards,

On Tue, Jul 12= , 2016 at 3:48 PM, Surinder Kumar <surinder.kumar@enterprise= db.com> wrote:
On Tue, J= ul 12, 2016 at 3:43 PM, Murtuza Zabuawala <murtuza.zabuaw= ala@enterprisedb.com> wrote:
Hi,

Just a heads up, This issue is occurs only in runtime & If you t= ry in web everything works fine when you provide unicode characters as obje= ct name.
No, this issue is reported for both w= eb and runtime application. It is reproducible to me in web application.

Now sure but the i= ssue is when runtime(QtWebkit) sends data it does not encodes it properly &= amp; this should be generic fix in runtime.

Regard= s,
Murtuza

--=
Regards,
Murtuza ZabuawalaE= nterpriseDB:=C2=A0http://www.enter= prisedb.com
The Enterprise PostgreSQL Company


On Tue, Jul 12, 2016 at 3:27 PM, S= urinder Kumar <surinder.kumar@enterprisedb.com> wrote:
Hi
=
What is happening in code?
Database is= created with Chinese characters successfully with ascii values(Chinese cha= racters converted to ascii) before saving internally.

<= div>but when database properties is retrieved by name, it fails to fetch da= ta and throws UnicodeError.

Solution:
=
Database name should be encoded in 'utf-8' before storing to d= atabase.
This resolved the issue.=C2=A0
I have tested t= his patch by creating database name using Japanese and Chinese characters. = It works.

Also referenced the code to set defau= lt encoding to 'uff-8' before start of application.
<= a href=3D"https://github.com/joeyespo/grip/issues/86" target=3D"_blank">htt= ps://github.com/joeyespo/grip/issues/86

@A= shesh/@Dave can you please review the patch?
If it looks good, we= can do the same changes in case of other nodes.

T= hanks,
Surinder Kumar




--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers=





--94eb2c08eeb0b9ebb305376ddbf5--