pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: lsliang <lsliang@pconline.com.cn>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: can  postgresql  supported   utf8mb4    character sets?
Date: Fri, 06 Mar 2015 06:55:20 -0800
Message-ID: <54F9BFD8.7080907@aklaver.com> (raw)
In-Reply-To: <201503061055293002598@pconline.com.cn>
References: <201503051745459170125@pconline.com.cn>
	<201503061055293002598@pconline.com.cn>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

On 03/05/2015 06:55 PM, lsliang wrote:
> 2015-03-06
> *
> *
> ------------------------------------------------------------------------
> *发件人:*Adrian Klaver
> *发送时间:*2015-03-05 21:31:39
> *收件人:*lsliang; pgsql-general
> *抄送:*
> *主题:*Re: [GENERAL] can postgresql supported utf8mb4 character sets?
> On 03/05/2015 01:45 AM, lsliang wrote:
>  > can  postgresql supported   utf8mb4  character set?
>  > today   mobile  apps support   4-byte  character   and  utf8 can only
>  > support  1-3 bytes character
> The docs would seem to indicate otherwise:
> http://www.postgresql.org/docs/9.3/interactive/multibyte.html
> http://en.wikipedia.org/wiki/UTF-8
>  > if   load  string  to database which  contain  a  4-byte character
>  > will failed  .
> Have you actually tried to load strings in to Postgres?
> If so and it failed what was the method you used and what was the error?
>  > mysql   since  5.5.3 support utf8mb4 character sets
>  > I don't  find  some information about  postgresql
>  >   thanks
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> thanks   for  your help .
>   postgresql   can support   4-byte character
> test=> select * from utf8mb4_test ;
> ERROR:  character with byte sequence 0xf0 0x9f 0x98 0x84 in encoding "UTF8" has no equivalent in encoding "GB18030"
> test=> \encoding utf8
> test=> select * from utf8mb4_test ;
>   content
> ---------
>   😄
>   😄
> pcauto=>


FYI, you can force the client encoding:

http://www.postgresql.org/docs/9.4/interactive/app-psql.html

"If both standard input and standard output are a terminal, then psql 
sets the client encoding to "auto", which will detect the appropriate 
client encoding from the locale settings (LC_CTYPE environment variable 
on Unix systems). If this doesn't work out as expected, the client 
encoding can be overridden using the environment variable PGCLIENTENCODING."



-- 
Adrian Klaver
adrian.klaver@aklaver.com


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



view thread (5+ messages)  latest in thread

Message-ID: <54F9BFD8.7080907@aklaver.com>
Permalink:  ../54F9BFD8.7080907@aklaver.com/
Also on:    postgresql.org/message-id/54F9BFD8.7080907@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, lsliang@pconline.com.cn
  Subject: Re: can  postgresql  supported   utf8mb4    character sets?
  In-Reply-To: <54F9BFD8.7080907@aklaver.com>
  References: <201503051745459170125@pconline.com.cn> <201503061055293002598@pconline.com.cn> <54F9BFD8.7080907@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox