Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlCYF-0007od-3k for pgsql-general@arkaria.postgresql.org; Tue, 16 Jun 2020 14:26:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jlCYD-0002Ov-VT for pgsql-general@arkaria.postgresql.org; Tue, 16 Jun 2020 14:26:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlCYD-0002Om-MF for pgsql-general@lists.postgresql.org; Tue, 16 Jun 2020 14:26:57 +0000 Received: from p3nlsmtpcp01-04.prod.phx3.secureserver.net ([184.168.200.145]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlCYA-0006gj-Sw for pgsql-general@lists.postgresql.org; Tue, 16 Jun 2020 14:26:57 +0000 Received: from p3plcpnl0888.prod.phx3.secureserver.net ([50.62.177.188]) by : HOSTING RELAY : with ESMTP id lCX8jZYlKaN0MlCX8jxZGQ; Tue, 16 Jun 2020 07:25:50 -0700 X-CMAE-Analysis: v=2.3 cv=O4JHQy1W c=1 sm=1 tr=0 a=rB3+t/t3Q5ykOnW3O43mFw==:117 a=Ejc0Kqoo9U5Xzpm1U49U6A==:17 a=9+rZDBEiDlHhcck0kWbJtElFXBc=:19 a=nTHF0DUjJn0A:10 a=r77TgQKjGQsHNAKrUKIA:9 a=RJ8zk90xdf_qob1PCe8A:9 a=QEXdDO2ut3YA:10 a=klHgJUn5zKMtKEYIvlwA:9 a=C3kzotLhGJaQS8k4:21 a=_W_S_7VecoQA:10 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=QOGEsqRv6VhmHaoFNykA:22 X-SECURESERVER-ACCT: testmail@gisspecialists.com Received: from 72-53-133-176.cpe.distributel.net ([72.53.133.176]:50929 helo=[192.168.1.102]) by p3plcpnl0888.prod.phx3.secureserver.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1jlCX8-00F8gv-IB for pgsql-general@lists.postgresql.org; Tue, 16 Jun 2020 07:25:50 -0700 From: Jean Gabriel Subject: PSQL console encoding To: pgsql-general@lists.postgresql.org Message-ID: <601fb533-ec08-b485-d0e4-b401c3dd4830@GISspecialists.com> Date: Tue, 16 Jun 2020 10:25:55 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------8087128CCE5201C5B45B3D3C" Content-Language: en-US X-Antivirus: Avast (VPS 200615-4, 2020-06-15), Outbound message X-Antivirus-Status: Clean X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - p3plcpnl0888.prod.phx3.secureserver.net X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - GISspecialists.com X-Get-Message-Sender-Via: p3plcpnl0888.prod.phx3.secureserver.net: authenticated_id: testmail@gisspecialists.com X-Authenticated-Sender: p3plcpnl0888.prod.phx3.secureserver.net: testmail@gisspecialists.com X-Source: X-Source-Args: X-Source-Dir: X-CMAE-Envelope: MS4wfFH5Lz2f6VYX5pfDiZzdx1mLq6QaRd2lJc7Xo8gZ6JBK3mwD7aLJkdQk5EBB0JtFL4LOQ58IyayGOGha27/csnFVrrsVoe2Qt0WMTyuHWKVPtAeHeNYT AuWQitm5k5oAqdWelbbCSEBy9kJy6ZcmaSlExydMWqyiiWp2ICFCi5nc9T+nB6F6mkxU2CgGU+PVZuRbWEZenvuwQsJvDCUWPQhIw4ab9RJrIEVzjud3kVgT List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------8087128CCE5201C5B45B3D3C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hello, I am having some issues setting/using my PSQL console encoding to UTF-8 under Windows 10. I have a Windows server and client. The |Postgres 12| database contains tables with content in multiple languages (ex: English, French (with characters such as |é|), Korean (with characters such as |브|)). select version();                           version ------------------------------------------------------------  PostgreSQL 12.1, compiled by Visual C++ build 1914, 64-bit The DB is encoded as |UTF8| | | |show server_encoding;  server_encoding -----------------  UTF8| | | The |client_encoding| is set to |UTF8| | | | show client_encoding;  client_encoding -----------------  UTF8| | | The console code page is set to |65001| (Microsoft's UTF8 codepage), and has a suitable font ( |Lucida Console|). I nevertheless get the different code page warning when logging to my DB psql (12.1) WARNING: Console code page (65001) differs from Windows code page (1252)          8-bit characters might not work correctly. See psql reference          page "Notes for Windows users" for details. I must be able to properly display English and French text, query the DB in English and French and be able to "output something", i.e. not get any error, if touching text in another language. The issue is I can't type / copy-paste any accented character. If I do, the special character acts as a comment but the input continues on the next line, and I need to close it again. In the following example, note that |é_fg| is gone, that there is no prompt on the |hij| line and that the output concatenates |abcd_hij| on one line |myuser=>select'abcd_é_fg';hij myuser'> klm';?column?----------abcd_hij+klm (1row)| The issue is really with the typing, because I can export and load files containing such chars. Ex: save |select 'é';| in |sel.sql|, run |psql -U myuser -d mydb -f C:/sel.sql| will output |?column?----------é| ------------------------------------------------------------------------ On the working well side, I can display what I need |selectchr(8217);--sort of apostrophechr -----’selectchr(48652);chr -----브--(though displayed as a square - unknown character, ok)| ------------------------------------------------------------------------ I have tried to set |Windows language for non-unicode program| to |UTF8|, which had no effect on the issue. The setting was recognized as the PSQL warning (Console code page (65001) differs from Windows code page (1252)) was not displayed anymore, but I still couldn't do select 'é'; If I set the code page to |1252| and the |client-encoding| to |win1252|, I can display the accented chars, I can type them, but if I want to display text in another language like Korean I get and error |selectchr(48652);ERROR:character withbyte sequence 0xeb0xb80x8cinencoding "UTF8"has no equivalent inencoding "WIN1252" | ||So back to the question, is there a way of having a working UTF8 psql console? Thank you, Jean Gabriel --------------8087128CCE5201C5B45B3D3C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hello,

I am having some issues setting/using my PSQL console encoding to UTF-8 under Windows 10.


I have a Windows server and client. The Postgres 12 database contains tables with content in multiple languages (ex: English, French (with characters such as é), Korean (with characters such as 브)).


select version();
                          version
------------------------------------------------------------
 PostgreSQL 12.1, compiled by Visual C++ build 1914, 64-bit


The DB is encoded as UTF8


show server_encoding;
 server_encoding
-----------------
 UTF8


The client_encoding is set to UTF8


 show client_encoding;
 client_encoding
-----------------
 UTF8


The console code page is set to 65001 (Microsoft's UTF8 codepage), and has a suitable font ( Lucida Console).


I nevertheless get the different code page warning when logging to my DB

psql (12.1)
WARNING: Console code page (65001) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.



I must be able to properly display English and French text, query the DB in English and French and be able to "output something", i.e. not get any error, if touching text in another language.

The issue is I can't type / copy-paste any accented character. If I do, the special character acts as a comment but the input continues on the next line, and I need to close it again.

In the following example, note that é_fg is gone, that there is no prompt on the hij line and that the output concatenates abcd_hij on one line

myuser=> select 'abcd_é_fg';
hij
myuser'> klm';
 ?column?
----------
 abcd_hij+
 klm
(1 row)

The issue is really with the typing, because I can export and load files containing such chars.
Ex: save select 'é'; in sel.sql, run psql -U myuser -d mydb -f C:/sel.sql will output

 ?column?
----------
 é

On the working well side, I can display what I need

select chr(8217); --sort of apostrophe
 chr
-----
 ’

select chr(48652);
 chr
-----
 브 --(though displayed as a square - unknown character, ok)

I have tried to set Windows language for non-unicode program to UTF8, which had no effect on the issue. The setting was recognized as the PSQL warning (Console code page (65001) differs from Windows code page (1252)) was not displayed anymore, but I still couldn't do   select 'é';

If I set the code page to 1252 and the client-encoding to win1252, I can display the accented chars, I can type them, but if I want to display text in another language like Korean I get and error

select chr(48652);
ERROR:  character with byte sequence 0xeb 0xb8 0x8c in encoding "UTF8" has no equivalent in encoding "WIN1252"

So back to the question, is there a way of having a working UTF8 psql console?

Thank you,
Jean Gabriel
--------------8087128CCE5201C5B45B3D3C--