public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter J. Holzer <[email protected]>
To: [email protected]
Subject: Re: List of encodings
Date: Mon, 20 Apr 2026 07:53:52 +0200
Message-ID: <nczevu7hf7mmdcetcvzymtl5ttlcltba3vuwm36ubi3fmyrdir@ldi6iai6jzen> (raw)
In-Reply-To: <CA+FnnTxJyrnxR0hhV8T8J7Gb=MZ=OrtrEUcyoMf14-WHKgSb-A@mail.gmail.com>
References: <CA+FnnTxFMiA+KMfypfGyY43G2kSx6-t5A351snUMmWC-2Lxvaw@mail.gmail.com>
	<CAKFQuwZOH6BPtaWJKr9jRGxdJt05YtLAZn1s_fYt=uzAASm9CQ@mail.gmail.com>
	<CA+FnnTymNs9_3pBci01_Uu5OTNJFngOhu8_khpmUs88V8kX86Q@mail.gmail.com>
	<[email protected]>
	<CA+FnnTzx90AzTu07zVGMCYmvBYs_VsL9k2E7eBkzg_rTRwZbeA@mail.gmail.com>
	<[email protected]>
	<CA+FnnTxJyrnxR0hhV8T8J7Gb=MZ=OrtrEUcyoMf14-WHKgSb-A@mail.gmail.com>

On 2026-04-19 20:13:29 -0500, Igor Korot wrote:
> So, let's say I chose "BIG5"".
> 
> As stated the table contains:
> 
>  big5_to_utf8                   | BIG5           | t
>  big5_to_euc_tw                 | BIG5           | t
>  big5_to_mic                    | BIG5           | t
> 
> Since all 3 are default character sets, which one would be chosen?
> (in the context of CREATE DATABASE)

Note that the table contains *two* encodings (conforencoding and
contoencoding) for each conversion. If you look at both it becomes
clear:

hjp=> select conname,
        pg_encoding_to_char(conforencoding) as for_enc,
        pg_encoding_to_char(contoencoding) to_enc,
        condefault
      from pg_conversion
      where conname like 'big5%';
╔════════════════╤═════════╤═══════════════╤════════════╗
║    conname     │ for_enc │    to_enc     │ condefault ║
╟────────────────┼─────────┼───────────────┼────────────╢
║ big5_to_euc_tw │ BIG5    │ EUC_TW        │ t          ║
║ big5_to_mic    │ BIG5    │ MULE_INTERNAL │ t          ║
║ big5_to_utf8   │ BIG5    │ UTF8          │ t          ║
╚════════════════╧═════════╧═══════════════╧════════════╝
(3 rows)

If you need to convert from BIG5 to UTF8, big5_to_utf8 is the default
(and indeed only) conversion. If you need to convert from BIG5 to
EUC_TW, it's big5_to_euc_tw, etc.

        hjp


-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | [email protected]         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"


Attachments:

  [application/pgp-signature] signature.asc (833B, 2-signature.asc)
  download

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: List of encodings
  In-Reply-To: <nczevu7hf7mmdcetcvzymtl5ttlcltba3vuwm36ubi3fmyrdir@ldi6iai6jzen>

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

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