Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMuvA-0005V7-I0 for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jul 2016 10:28:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bMuv9-0002DQ-TK for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jul 2016 10:28:07 +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 1bMuuw-0001zN-TS for pgadmin-hackers@postgresql.org; Tue, 12 Jul 2016 10:27:54 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bMuus-0006Jp-SC for pgadmin-hackers@postgresql.org; Tue, 12 Jul 2016 10:27:54 +0000 Received: by mail-wm0-x22e.google.com with SMTP id o80so19290036wme.1 for ; Tue, 12 Jul 2016 03:27:49 -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=pAPjSO10NEtvXuMRedmIqitqxFKAG/ZDaI+znSZCVpo=; b=dD2IUuA1m/t0k6/VTxLwaf+3JHTnOhFHuuRJ/GtwQII0X5nBC3M2e76qDam8duHV2N Ubz2EVEye41BjHkmk4HxBCB9ga7EjKYpBB5vFDXd97Sl7xqtJhYtwYOqxKN3bMGvbEl4 WBK8UtQIe41EKlUAmGRhDe/nsCCLQA6AIhZAbjETukA4/2UWgnPmAvEupy5UPlfx5b9m PQrpPOWUbxIntFjPKwJP4//nAAwWAvDwSKhLfoxm8S6hs3K5ZqLhkLbXwc84LK8HsPD8 d8EuYscPdXUTzadbJTMkYaALNTc3I9oAzlJoTqdR9AM12/9+nKOxZQFe9VzDm9MmvBDO ccjQ== 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=pAPjSO10NEtvXuMRedmIqitqxFKAG/ZDaI+znSZCVpo=; b=cfNEZGUaUh1hYkUj18Yne0/vF6WniB3RhEyf1C/83uo4w1MAd7PybhzoJBVjBJLyH0 lf/7cdf9XLKQz47UbSPZP5uQv9w9knWV9T+u19Apca483X4TfC60v99M1QWC6DpxJIst XYGRwBUvFlxcNYSNtXrBU4SBkHIuwxG6Vhh16UP0S7BYL/QPoHQ+Zlq+6lZ0Vhx2SVt3 Aoa8q0Nc8PBfWk6biRRALjbIEJcy6egYSIMKkbevpBr2gmfsbsdaDizDvLEDoG8Oi4dp qwms54mUFR3KzmaWvhC0XZ/N/LxFkZDY1Yyb4TBQdSC6sWL6UP4moIkhKNSu/Y1kaEva 5s7A== X-Gm-Message-State: ALyK8tIay86CRp2u0ZmulQfXRAwV5tgqxPAgDoCpHouyXFDAzZsZN7jWLw2viI8QsDe47ZpjNvkobcVAwpN75NQu X-Received: by 10.28.50.199 with SMTP id y190mr14621991wmy.61.1468319269288; Tue, 12 Jul 2016 03:27:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.54.164 with HTTP; Tue, 12 Jul 2016 03:27:19 -0700 (PDT) In-Reply-To: References: From: Surinder Kumar Date: Tue, 12 Jul 2016 15:57:19 +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: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a1147da0c769ce105376db8c7 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 --001a1147da0c769ce105376db8c7 Content-Type: text/plain; charset=UTF-8 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. > It is reproducible for me on Mac OS X Yosemite version 10.10.2 Python version: 2.7 Browsers: Chrome & Firefox. > >> 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 >>> >>> >> > --001a1147da0c769ce105376db8c7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 w= orks 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.
=
It is reproducible for me on=C2=A0
Mac OS= X Yosemite version=C2=A010.10.2=C2=A0
Python version: 2.7
<= div>Browsers: Chrome & Firefox.
=

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

Regards= ,
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=




--001a1147da0c769ce105376db8c7--