2010-09-20 22:08:53 +02:00
|
|
|
<!-- doc/src/sgml/charset.sgml -->
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2000-09-30 18:58:20 +02:00
|
|
|
<chapter id="charset">
|
2011-01-29 19:00:18 +01:00
|
|
|
<title>Localization</title>
|
2000-09-30 18:58:20 +02:00
|
|
|
|
2003-03-24 15:32:51 +01:00
|
|
|
<para>
|
|
|
|
This chapter describes the available localization features from the
|
|
|
|
point of view of the administrator.
|
2010-02-03 18:25:06 +01:00
|
|
|
<productname>PostgreSQL</productname> supports two localization
|
|
|
|
facilities:
|
2000-09-12 07:37:09 +02:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-09-30 18:58:20 +02:00
|
|
|
Using the locale features of the operating system to provide
|
2001-11-18 21:33:32 +01:00
|
|
|
locale-specific collation order, number formatting, translated
|
|
|
|
messages, and other aspects.
|
2017-11-23 15:39:47 +01:00
|
|
|
This is covered in <xref linkend="locale"/> and
|
|
|
|
<xref linkend="collation"/>.
|
2000-09-12 07:37:09 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2009-05-06 18:15:21 +02:00
|
|
|
Providing a number of different character sets to support storing text
|
|
|
|
in all kinds of languages, and providing character set translation
|
|
|
|
between client and server.
|
2017-11-23 15:39:47 +01:00
|
|
|
This is covered in <xref linkend="multibyte"/>.
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
2000-09-12 07:37:09 +02:00
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
|
|
|
|
2000-09-30 18:58:20 +02:00
|
|
|
|
|
|
|
<sect1 id="locale">
|
|
|
|
<title>Locale Support</title>
|
2009-03-26 21:55:49 +01:00
|
|
|
|
2017-10-09 03:44:17 +02:00
|
|
|
<indexterm zone="locale"><primary>locale</primary></indexterm>
|
2001-11-12 20:19:39 +01:00
|
|
|
|
2000-09-30 18:58:20 +02:00
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
<firstterm>Locale</firstterm> support refers to an application respecting
|
2000-09-30 18:58:20 +02:00
|
|
|
cultural preferences regarding alphabets, sorting, number
|
2017-10-09 03:44:17 +02:00
|
|
|
formatting, etc. <productname>PostgreSQL</productname> uses the standard ISO
|
2003-03-24 15:32:51 +01:00
|
|
|
C and <acronym>POSIX</acronym> locale facilities provided by the server operating
|
2001-01-19 05:47:50 +01:00
|
|
|
system. For additional information refer to the documentation of your
|
2000-09-30 18:58:20 +02:00
|
|
|
system.
|
|
|
|
</para>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect2 id="locale-overview">
|
2011-01-29 19:00:18 +01:00
|
|
|
<title>Overview</title>
|
2000-09-30 18:58:20 +02:00
|
|
|
|
2002-04-03 07:39:33 +02:00
|
|
|
<para>
|
|
|
|
Locale support is automatically initialized when a database
|
|
|
|
cluster is created using <command>initdb</command>.
|
|
|
|
<command>initdb</command> will initialize the database cluster
|
2004-03-23 03:47:35 +01:00
|
|
|
with the locale setting of its execution environment by default,
|
|
|
|
so if your system is already set to use the locale that you want
|
|
|
|
in your database cluster then there is nothing else you need to
|
|
|
|
do. If you want to use a different locale (or you are not sure
|
|
|
|
which locale your system is set to), you can instruct
|
|
|
|
<command>initdb</command> exactly which locale to use by
|
|
|
|
specifying the <option>--locale</option> option. For example:
|
2000-09-30 18:58:20 +02:00
|
|
|
<screen>
|
2003-03-13 02:30:29 +01:00
|
|
|
initdb --locale=sv_SE
|
2000-09-30 18:58:20 +02:00
|
|
|
</screen>
|
|
|
|
</para>
|
|
|
|
|
2001-11-18 21:33:32 +01:00
|
|
|
<para>
|
2009-03-26 21:55:49 +01:00
|
|
|
This example for Unix systems sets the locale to Swedish
|
2017-10-09 03:44:17 +02:00
|
|
|
(<literal>sv</literal>) as spoken
|
|
|
|
in Sweden (<literal>SE</literal>). Other possibilities might include
|
|
|
|
<literal>en_US</literal> (U.S. English) and <literal>fr_CA</literal> (French
|
2010-02-03 18:25:06 +01:00
|
|
|
Canadian). If more than one character set can be used for a
|
2010-02-28 03:19:47 +01:00
|
|
|
locale then the specifications can take the form
|
2017-10-09 03:44:17 +02:00
|
|
|
<replaceable>language_territory.codeset</replaceable>. For example,
|
|
|
|
<literal>fr_BE.UTF-8</literal> represents the French language (fr) as
|
|
|
|
spoken in Belgium (BE), with a <acronym>UTF-8</acronym> character set
|
2010-02-28 03:19:47 +01:00
|
|
|
encoding.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2010-02-28 03:20:40 +01:00
|
|
|
What locales are available on your
|
2010-02-03 18:25:06 +01:00
|
|
|
system under what names depends on what was provided by the operating
|
2008-07-15 03:35:23 +02:00
|
|
|
system vendor and what was installed. On most Unix systems, the command
|
2017-10-09 03:44:17 +02:00
|
|
|
<literal>locale -a</literal> will provide a list of available locales.
|
|
|
|
Windows uses more verbose locale names, such as <literal>German_Germany</literal>
|
|
|
|
or <literal>Swedish_Sweden.1252</literal>, but the principles are the same.
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Occasionally it is useful to mix rules from several locales, e.g.,
|
2003-03-24 15:32:51 +01:00
|
|
|
use English collation rules but Spanish messages. To support that, a
|
2010-02-03 18:25:06 +01:00
|
|
|
set of locale subcategories exist that control only certain
|
|
|
|
aspects of the localization rules:
|
2000-09-30 18:58:20 +02:00
|
|
|
|
|
|
|
<informaltable>
|
|
|
|
<tgroup cols="2">
|
2020-05-06 21:58:23 +02:00
|
|
|
<colspec colname="col1" colwidth="1*"/>
|
|
|
|
<colspec colname="col2" colwidth="3*"/>
|
2000-09-30 18:58:20 +02:00
|
|
|
<tbody>
|
|
|
|
<row>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><envar>LC_COLLATE</envar></entry>
|
|
|
|
<entry>String sort order</entry>
|
2000-09-30 18:58:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><envar>LC_CTYPE</envar></entry>
|
|
|
|
<entry>Character classification (What is a letter? Its upper-case equivalent?)</entry>
|
2000-09-30 18:58:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><envar>LC_MESSAGES</envar></entry>
|
|
|
|
<entry>Language of messages</entry>
|
2000-09-30 18:58:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><envar>LC_MONETARY</envar></entry>
|
|
|
|
<entry>Formatting of currency amounts</entry>
|
2000-09-30 18:58:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><envar>LC_NUMERIC</envar></entry>
|
|
|
|
<entry>Formatting of numbers</entry>
|
2000-09-30 18:58:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><envar>LC_TIME</envar></entry>
|
|
|
|
<entry>Formatting of dates and times</entry>
|
2000-09-30 18:58:20 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</informaltable>
|
|
|
|
|
2002-04-03 07:39:33 +02:00
|
|
|
The category names translate into names of
|
|
|
|
<command>initdb</command> options to override the locale choice
|
|
|
|
for a specific category. For instance, to set the locale to
|
|
|
|
French Canadian, but use U.S. rules for formatting currency, use
|
|
|
|
<literal>initdb --locale=fr_CA --lc-monetary=en_US</literal>.
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If you want the system to behave as if it had no locale support,
|
2017-10-09 03:44:17 +02:00
|
|
|
use the special locale name <literal>C</literal>, or equivalently
|
|
|
|
<literal>POSIX</literal>.
|
2002-04-03 07:39:33 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2010-02-03 18:25:06 +01:00
|
|
|
Some locale categories must have their values
|
2008-09-23 11:20:39 +02:00
|
|
|
fixed when the database is created. You can use different settings
|
|
|
|
for different databases, but once a database is created, you cannot
|
|
|
|
change them for that database anymore. <literal>LC_COLLATE</literal>
|
2011-03-08 23:10:34 +01:00
|
|
|
and <literal>LC_CTYPE</literal> are these categories. They affect
|
2008-09-23 11:20:39 +02:00
|
|
|
the sort order of indexes, so they must be kept fixed, or indexes on
|
2011-03-08 23:10:34 +01:00
|
|
|
text columns would become corrupt.
|
|
|
|
(But you can alleviate this restriction using collations, as discussed
|
2017-11-23 15:39:47 +01:00
|
|
|
in <xref linkend="collation"/>.)
|
2011-03-08 23:10:34 +01:00
|
|
|
The default values for these
|
2009-03-26 21:55:49 +01:00
|
|
|
categories are determined when <command>initdb</command> is run, and
|
2008-09-23 11:20:39 +02:00
|
|
|
those values are used when new databases are created, unless
|
|
|
|
specified otherwise in the <command>CREATE DATABASE</command> command.
|
2002-04-03 07:39:33 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2009-03-26 21:55:49 +01:00
|
|
|
The other locale categories can be changed whenever desired
|
|
|
|
by setting the server configuration parameters
|
2002-04-03 07:39:33 +02:00
|
|
|
that have the same name as the locale categories (see <xref
|
2017-11-23 15:39:47 +01:00
|
|
|
linkend="runtime-config-client-format"/> for details). The values
|
2009-03-26 21:55:49 +01:00
|
|
|
that are chosen by <command>initdb</command> are actually only written
|
|
|
|
into the configuration file <filename>postgresql.conf</filename> to
|
2011-03-08 23:10:34 +01:00
|
|
|
serve as defaults when the server is started. If you remove these
|
2002-04-03 07:39:33 +02:00
|
|
|
assignments from <filename>postgresql.conf</filename> then the
|
2005-04-16 18:50:01 +02:00
|
|
|
server will inherit the settings from its execution environment.
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2001-11-18 21:33:32 +01:00
|
|
|
Note that the locale behavior of the server is determined by the
|
|
|
|
environment variables seen by the server, not by the environment
|
2002-04-03 07:39:33 +02:00
|
|
|
of any client. Therefore, be careful to configure the correct locale settings
|
2001-11-18 21:33:32 +01:00
|
|
|
before starting the server. A consequence of this is that if
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
client and server are set up in different locales, messages might
|
2001-11-18 21:33:32 +01:00
|
|
|
appear in different languages depending on where they originated.
|
2001-01-19 05:47:50 +01:00
|
|
|
</para>
|
|
|
|
|
2002-04-03 07:39:33 +02:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
When we speak of inheriting the locale from the execution
|
|
|
|
environment, this means the following on most operating systems:
|
|
|
|
For a given locale category, say the collation, the following
|
|
|
|
environment variables are consulted in this order until one is
|
|
|
|
found to be set: <envar>LC_ALL</envar>, <envar>LC_COLLATE</envar>
|
2009-05-06 18:15:21 +02:00
|
|
|
(or the variable corresponding to the respective category),
|
2002-04-03 07:39:33 +02:00
|
|
|
<envar>LANG</envar>. If none of these environment variables are
|
|
|
|
set then the locale defaults to <literal>C</literal>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Some message localization libraries also look at the environment
|
|
|
|
variable <envar>LANGUAGE</envar> which overrides all other locale
|
|
|
|
settings for the purpose of setting the language of messages. If
|
|
|
|
in doubt, please refer to the documentation of your operating
|
2003-03-24 15:32:51 +01:00
|
|
|
system, in particular the documentation about
|
2017-10-09 03:44:17 +02:00
|
|
|
<application>gettext</application>.
|
2002-04-03 07:39:33 +02:00
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2001-01-19 05:47:50 +01:00
|
|
|
<para>
|
2004-12-27 23:30:10 +01:00
|
|
|
To enable messages to be translated to the user's preferred language,
|
2009-05-06 18:15:21 +02:00
|
|
|
<acronym>NLS</acronym> must have been selected at build time
|
2017-10-09 03:44:17 +02:00
|
|
|
(<literal>configure --enable-nls</literal>). All other locale support is
|
2009-05-06 18:15:21 +02:00
|
|
|
built in automatically.
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect2 id="locale-behavior">
|
2011-01-29 19:00:18 +01:00
|
|
|
<title>Behavior</title>
|
2000-09-30 18:58:20 +02:00
|
|
|
|
|
|
|
<para>
|
2005-04-16 18:50:01 +02:00
|
|
|
The locale settings influence the following SQL features:
|
2000-09-30 18:58:20 +02:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
Sort order in queries using <literal>ORDER BY</literal> or the standard
|
2009-03-26 21:55:49 +01:00
|
|
|
comparison operators on textual data
|
2017-10-09 03:44:17 +02:00
|
|
|
<indexterm><primary>ORDER BY</primary><secondary>and locales</secondary></indexterm>
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
2005-01-04 01:05:45 +01:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
The <function>upper</function>, <function>lower</function>, and <function>initcap</function>
|
2011-04-11 00:02:17 +02:00
|
|
|
functions
|
2017-10-09 03:44:17 +02:00
|
|
|
<indexterm><primary>upper</primary><secondary>and locales</secondary></indexterm>
|
|
|
|
<indexterm><primary>lower</primary><secondary>and locales</secondary></indexterm>
|
2005-01-04 01:05:45 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
2005-04-16 18:50:01 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
Pattern matching operators (<literal>LIKE</literal>, <literal>SIMILAR TO</literal>,
|
2011-04-11 00:02:17 +02:00
|
|
|
and POSIX-style regular expressions); locales affect both case
|
|
|
|
insensitive matching and the classification of characters by
|
|
|
|
character-class regular expressions
|
2017-10-09 03:44:17 +02:00
|
|
|
<indexterm><primary>LIKE</primary><secondary>and locales</secondary></indexterm>
|
|
|
|
<indexterm><primary>regular expressions</primary><secondary>and locales</secondary></indexterm>
|
2005-04-16 18:50:01 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
2000-09-30 18:58:20 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
The <function>to_char</function> family of functions
|
|
|
|
<indexterm><primary>to_char</primary><secondary>and locales</secondary></indexterm>
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
2011-04-11 00:02:17 +02:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
The ability to use indexes with <literal>LIKE</literal> clauses
|
2011-04-11 00:02:17 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
2000-09-30 18:58:20 +02:00
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
The drawback of using locales other than <literal>C</literal> or
|
|
|
|
<literal>POSIX</literal> in <productname>PostgreSQL</productname> is its performance
|
2005-01-04 01:05:45 +01:00
|
|
|
impact. It slows character handling and prevents ordinary indexes
|
2017-10-09 03:44:17 +02:00
|
|
|
from being used by <literal>LIKE</literal>. For this reason use locales
|
2005-01-04 01:05:45 +01:00
|
|
|
only if you actually need them.
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
2005-03-17 01:22:24 +01:00
|
|
|
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
As a workaround to allow <productname>PostgreSQL</productname> to use indexes
|
|
|
|
with <literal>LIKE</literal> clauses under a non-C locale, several custom
|
2005-03-17 01:22:24 +01:00
|
|
|
operator classes exist. These allow the creation of an index that
|
|
|
|
performs a strict character-by-character comparison, ignoring
|
2017-11-23 15:39:47 +01:00
|
|
|
locale comparison rules. Refer to <xref linkend="indexes-opclass"/>
|
2011-03-20 17:43:39 +01:00
|
|
|
for more information. Another approach is to create indexes using
|
2017-10-09 03:44:17 +02:00
|
|
|
the <literal>C</literal> collation, as discussed in
|
2017-11-23 15:39:47 +01:00
|
|
|
<xref linkend="collation"/>.
|
2005-03-17 01:22:24 +01:00
|
|
|
</para>
|
2022-03-17 11:11:21 +01:00
|
|
|
</sect2>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect2 id="locale-selecting-locales">
|
2022-03-17 11:11:21 +01:00
|
|
|
<title>Selecting Locales</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Locales can be selected in different scopes depending on requirements.
|
|
|
|
The above overview showed how locales are specified using
|
|
|
|
<command>initdb</command> to set the defaults for the entire cluster. The
|
|
|
|
following list shows where locales can be selected. Each item provides
|
|
|
|
the defaults for the subsequent items, and each lower item allows
|
|
|
|
overriding the defaults on a finer granularity.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<orderedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
As explained above, the environment of the operating system provides the
|
|
|
|
defaults for the locales of a newly initialized database cluster. In
|
|
|
|
many cases, this is enough: If the operating system is configured for
|
|
|
|
the desired language/territory, then
|
|
|
|
<productname>PostgreSQL</productname> will by default also behave
|
|
|
|
according to that locale.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
As shown above, command-line options for <command>initdb</command>
|
|
|
|
specify the locale settings for a newly initialized database cluster.
|
|
|
|
Use this if the operating system does not have the locale configuration
|
|
|
|
you want for your database system.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
A locale can be selected separately for each database. The SQL command
|
|
|
|
<command>CREATE DATABASE</command> and its command-line equivalent
|
|
|
|
<command>createdb</command> have options for that. Use this for example
|
2022-04-13 23:16:05 +02:00
|
|
|
if a database cluster houses databases for multiple tenants with
|
2022-03-17 11:11:21 +01:00
|
|
|
different requirements.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Locale settings can be made for individual table columns. This uses an
|
|
|
|
SQL object called <firstterm>collation</firstterm> and is explained in
|
|
|
|
<xref linkend="collation"/>. Use this for example to sort data in
|
|
|
|
different languages or customize the sort order of a particular table.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Finally, locales can be selected for an individual query. Again, this
|
|
|
|
uses SQL collation objects. This could be used to change the sort order
|
|
|
|
based on run-time choices or for ad-hoc experimentation.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</orderedlist>
|
|
|
|
</sect2>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect2 id="locale-providers">
|
2022-03-17 11:11:21 +01:00
|
|
|
<title>Locale Providers</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<productname>PostgreSQL</productname> supports multiple <firstterm>locale
|
|
|
|
providers</firstterm>. This specifies which library supplies the locale
|
|
|
|
data. One standard provider name is <literal>libc</literal>, which uses
|
|
|
|
the locales provided by the operating system C library. These are the
|
2022-04-13 23:16:05 +02:00
|
|
|
locales used by most tools provided by the operating system. Another
|
2022-03-17 11:11:21 +01:00
|
|
|
provider is <literal>icu</literal>, which uses the external
|
|
|
|
ICU<indexterm><primary>ICU</primary></indexterm> library. ICU locales can
|
|
|
|
only be used if support for ICU was configured when PostgreSQL was built.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The commands and tools that select the locale settings, as described
|
|
|
|
above, each have an option to select the locale provider. The examples
|
|
|
|
shown earlier all use the <literal>libc</literal> provider, which is the
|
|
|
|
default. Here is an example to initialize a database cluster using the
|
|
|
|
ICU provider:
|
|
|
|
<programlisting>
|
|
|
|
initdb --locale-provider=icu --icu-locale=en
|
|
|
|
</programlisting>
|
2022-04-13 23:16:05 +02:00
|
|
|
See the description of the respective commands and programs for
|
|
|
|
details. Note that you can mix locale providers at different
|
2022-03-17 11:11:21 +01:00
|
|
|
granularities, for example use <literal>libc</literal> by default for the
|
|
|
|
cluster but have one database that uses the <literal>icu</literal>
|
|
|
|
provider, and then have collation objects using either provider within
|
|
|
|
those databases.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Which locale provider to use depends on individual requirements. For most
|
|
|
|
basic uses, either provider will give adequate results. For the libc
|
|
|
|
provider, it depends on what the operating system offers; some operating
|
|
|
|
systems are better than others. For advanced uses, ICU offers more locale
|
|
|
|
variants and customization options.
|
|
|
|
</para>
|
2000-09-30 18:58:20 +02:00
|
|
|
</sect2>
|
2023-05-18 19:37:55 +02:00
|
|
|
<sect2 id="icu-locales">
|
|
|
|
<title>ICU Locales</title>
|
|
|
|
<sect3 id="icu-locale-names">
|
|
|
|
<title>ICU Locale Names</title>
|
|
|
|
<para>
|
|
|
|
The ICU format for the locale name is a <link
|
|
|
|
linkend="icu-language-tag">Language Tag</link>.
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
CREATE COLLATION mycollation1 (PROVIDER = icu, LOCALE = 'ja-JP');
|
|
|
|
CREATE COLLATION mycollation2 (PROVIDER = icu, LOCALE = 'fr');
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</sect3>
|
|
|
|
<sect3 id="icu-canonicalization">
|
|
|
|
<title>Locale Canonicalization and Validation</title>
|
|
|
|
<para>
|
|
|
|
When defining a new ICU collation object or database with ICU as the
|
|
|
|
provider, the given locale name is transformed ("canonicalized") into a
|
|
|
|
language tag if not already in that form. For instance,
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
CREATE COLLATION mycollation3 (PROVIDER = icu, LOCALE = 'en-US-u-kn-true');
|
|
|
|
NOTICE: using standard form "en-US-u-kn" for locale "en-US-u-kn-true"
|
|
|
|
CREATE COLLATION mycollation4 (PROVIDER = icu, LOCALE = 'de_DE.utf8');
|
|
|
|
NOTICE: using standard form "de-DE" for locale "de_DE.utf8"
|
|
|
|
</screen>
|
|
|
|
|
|
|
|
If you see this notice, ensure that the <symbol>PROVIDER</symbol> and
|
|
|
|
<symbol>LOCALE</symbol> are the expected result. For consistent results
|
|
|
|
when using the ICU provider, specify the canonical <link
|
|
|
|
linkend="icu-language-tag">language tag</link> instead of relying on the
|
|
|
|
transformation.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
A locale with no language name, or the special language name
|
|
|
|
<literal>root</literal>, is transformed to have the language
|
|
|
|
<literal>und</literal> ("undefined").
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
ICU can transform most libc locale names, as well as some other formats,
|
|
|
|
into language tags for easier transition to ICU. If a libc locale name is
|
|
|
|
used in ICU, it may not have precisely the same behavior as in libc.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
If there is a problem interpreting the locale name, or if the locale name
|
|
|
|
represents a language or region that ICU does not recognize, you will see
|
|
|
|
the following warning:
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
CREATE COLLATION nonsense (PROVIDER = icu, LOCALE = 'nonsense');
|
|
|
|
WARNING: ICU locale "nonsense" has unknown language "nonsense"
|
|
|
|
HINT: To disable ICU locale validation, set parameter icu_validation_level to DISABLED.
|
|
|
|
CREATE COLLATION
|
|
|
|
</screen>
|
2000-09-30 18:58:20 +02:00
|
|
|
|
2023-05-18 19:37:55 +02:00
|
|
|
<xref linkend="guc-icu-validation-level"/> controls how the message is
|
|
|
|
reported. Unless set to <literal>ERROR</literal>, the collation will
|
|
|
|
still be created, but the behavior may not be what the user intended.
|
|
|
|
</para>
|
|
|
|
</sect3>
|
|
|
|
<sect3 id="icu-language-tag">
|
|
|
|
<title>Language Tag</title>
|
|
|
|
<para>
|
|
|
|
A language tag, defined in BCP 47, is a standardized identifier used to
|
|
|
|
identify languages, regions, and other information about a locale.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Basic language tags are simply
|
|
|
|
<replaceable>language</replaceable><literal>-</literal><replaceable>region</replaceable>;
|
|
|
|
or even just <replaceable>language</replaceable>. The
|
|
|
|
<replaceable>language</replaceable> is a language code
|
|
|
|
(e.g. <literal>fr</literal> for French), and
|
|
|
|
<replaceable>region</replaceable> is a region code
|
|
|
|
(e.g. <literal>CA</literal> for Canada). Examples:
|
|
|
|
<literal>ja-JP</literal>, <literal>de</literal>, or
|
|
|
|
<literal>fr-CA</literal>.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Collation settings may be included in the language tag to customize
|
|
|
|
collation behavior. ICU allows extensive customization, such as
|
|
|
|
sensitivity (or insensitivity) to accents, case, and punctuation;
|
|
|
|
treatment of digits within text; and many other options to satisfy a
|
|
|
|
variety of uses.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
To include this additional collation information in a language tag,
|
|
|
|
append <literal>-u</literal>, which indicates there are additional
|
|
|
|
collation settings, followed by one or more
|
|
|
|
<literal>-</literal><replaceable>key</replaceable><literal>-</literal><replaceable>value</replaceable>
|
|
|
|
pairs. The <replaceable>key</replaceable> is the key for a <link
|
|
|
|
linkend="icu-collation-settings">collation setting</link> and
|
|
|
|
<replaceable>value</replaceable> is a valid value for that setting. For
|
|
|
|
boolean settings, the <literal>-</literal><replaceable>key</replaceable>
|
|
|
|
may be specified without a corresponding
|
|
|
|
<literal>-</literal><replaceable>value</replaceable>, which implies a
|
|
|
|
value of <literal>true</literal>.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
For example, the language tag <literal>en-US-u-kn-ks-level2</literal>
|
|
|
|
means the locale with the English language in the US region, with
|
|
|
|
collation settings <literal>kn</literal> set to <literal>true</literal>
|
|
|
|
and <literal>ks</literal> set to <literal>level2</literal>. Those
|
|
|
|
settings mean the collation will be case-insensitive and treat a sequence
|
|
|
|
of digits as a single number:
|
|
|
|
|
|
|
|
<screen>
|
|
|
|
CREATE COLLATION mycollation5 (PROVIDER = icu, DETERMINISTIC = false, LOCALE = 'en-US-u-kn-ks-level2');
|
|
|
|
SELECT 'aB' = 'Ab' COLLATE mycollation5 as result;
|
|
|
|
result
|
|
|
|
--------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
SELECT 'N-45' < 'N-123' COLLATE mycollation5 as result;
|
|
|
|
result
|
|
|
|
--------
|
|
|
|
t
|
|
|
|
(1 row)
|
|
|
|
</screen>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
See <xref linkend="icu-custom-collations"/> for details and additional
|
|
|
|
examples of using language tags with custom collation information for the
|
|
|
|
locale.
|
|
|
|
</para>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect2 id="locale-problems">
|
2011-01-29 19:00:18 +01:00
|
|
|
<title>Problems</title>
|
2000-09-30 18:58:20 +02:00
|
|
|
|
|
|
|
<para>
|
2007-09-29 00:25:49 +02:00
|
|
|
If locale support doesn't work according to the explanation above,
|
2003-03-24 15:32:51 +01:00
|
|
|
check that the locale support in your operating system is
|
|
|
|
correctly configured. To check what locales are installed on your
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
system, you can use the command <literal>locale -a</literal> if
|
2003-03-24 15:32:51 +01:00
|
|
|
your operating system provides it.
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
Check that <productname>PostgreSQL</productname> is actually using the locale
|
|
|
|
that you think it is. The <envar>LC_COLLATE</envar> and <envar>LC_CTYPE</envar>
|
2009-03-26 21:55:49 +01:00
|
|
|
settings are determined when a database is created, and cannot be
|
|
|
|
changed except by creating a new database. Other locale
|
2017-10-09 03:44:17 +02:00
|
|
|
settings including <envar>LC_MESSAGES</envar> and <envar>LC_MONETARY</envar>
|
2003-03-24 15:32:51 +01:00
|
|
|
are initially determined by the environment the server is started
|
2004-12-27 23:30:10 +01:00
|
|
|
in, but can be changed on-the-fly. You can check the active locale
|
2017-10-09 03:44:17 +02:00
|
|
|
settings using the <command>SHOW</command> command.
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
|
|
|
|
2001-11-19 04:58:25 +01:00
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
The directory <filename>src/test/locale</filename> in the source
|
2003-03-24 15:32:51 +01:00
|
|
|
distribution contains a test suite for
|
2017-10-09 03:44:17 +02:00
|
|
|
<productname>PostgreSQL</productname>'s locale support.
|
2000-09-30 18:58:20 +02:00
|
|
|
</para>
|
2001-11-18 21:33:32 +01:00
|
|
|
|
|
|
|
<para>
|
|
|
|
Client applications that handle server-side errors by parsing the
|
|
|
|
text of the error message will obviously have problems when the
|
2003-11-04 10:55:39 +01:00
|
|
|
server's messages are in a different language. Authors of such
|
|
|
|
applications are advised to make use of the error code scheme
|
|
|
|
instead.
|
2001-11-18 21:33:32 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Maintaining catalogs of message translations requires the on-going
|
|
|
|
efforts of many volunteers that want to see
|
2017-10-09 03:44:17 +02:00
|
|
|
<productname>PostgreSQL</productname> speak their preferred language well.
|
2004-12-27 23:30:10 +01:00
|
|
|
If messages in your language are currently not available or not fully
|
2001-11-18 21:33:32 +01:00
|
|
|
translated, your assistance would be appreciated. If you want to
|
2017-11-23 15:39:47 +01:00
|
|
|
help, refer to <xref linkend="nls"/> or write to the developers'
|
2003-01-19 01:13:31 +01:00
|
|
|
mailing list.
|
2001-11-18 21:33:32 +01:00
|
|
|
</para>
|
2000-09-30 18:58:20 +02:00
|
|
|
</sect2>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2011-02-08 22:04:18 +01:00
|
|
|
<sect1 id="collation">
|
|
|
|
<title>Collation Support</title>
|
|
|
|
|
2017-10-09 03:44:17 +02:00
|
|
|
<indexterm zone="collation"><primary>collation</primary></indexterm>
|
2011-03-25 23:21:25 +01:00
|
|
|
|
2011-02-08 22:04:18 +01:00
|
|
|
<para>
|
2011-04-11 00:02:17 +02:00
|
|
|
The collation feature allows specifying the sort order and character
|
|
|
|
classification behavior of data per-column, or even per-operation.
|
2011-03-08 23:10:34 +01:00
|
|
|
This alleviates the restriction that the
|
2011-02-08 22:04:18 +01:00
|
|
|
<symbol>LC_COLLATE</symbol> and <symbol>LC_CTYPE</symbol> settings
|
|
|
|
of a database cannot be changed after its creation.
|
|
|
|
</para>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect2 id="collation-concepts">
|
2011-02-08 22:04:18 +01:00
|
|
|
<title>Concepts</title>
|
|
|
|
|
|
|
|
<para>
|
2011-03-08 23:10:34 +01:00
|
|
|
Conceptually, every expression of a collatable data type has a
|
|
|
|
collation. (The built-in collatable data types are
|
2011-02-08 22:04:18 +01:00
|
|
|
<type>text</type>, <type>varchar</type>, and <type>char</type>.
|
2011-03-20 17:43:39 +01:00
|
|
|
User-defined base types can also be marked collatable, and of course
|
2021-07-30 20:50:21 +02:00
|
|
|
a <glossterm linkend="glossary-domain">domain</glossterm> over a
|
|
|
|
collatable data type is collatable.) If the
|
2011-03-08 23:10:34 +01:00
|
|
|
expression is a column reference, the collation of the expression is the
|
|
|
|
defined collation of the column. If the expression is a constant, the
|
2011-02-08 22:04:18 +01:00
|
|
|
collation is the default collation of the data type of the
|
2011-03-08 23:10:34 +01:00
|
|
|
constant. The collation of a more complex expression is derived
|
|
|
|
from the collations of its inputs, as described below.
|
2011-02-08 22:04:18 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2011-03-08 23:10:34 +01:00
|
|
|
The collation of an expression can be the <quote>default</quote>
|
|
|
|
collation, which means the locale settings defined for the
|
2011-03-20 17:43:39 +01:00
|
|
|
database. It is also possible for an expression's collation to be
|
|
|
|
indeterminate. In such cases, ordering operations and other
|
2011-02-08 22:04:18 +01:00
|
|
|
operations that need to know the collation will fail.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2011-04-11 00:02:17 +02:00
|
|
|
When the database system has to perform an ordering or a character
|
|
|
|
classification, it uses the collation of the input expression. This
|
2011-03-08 23:10:34 +01:00
|
|
|
happens, for example, with <literal>ORDER BY</literal> clauses
|
|
|
|
and function or operator calls such as <literal><</literal>.
|
|
|
|
The collation to apply for an <literal>ORDER BY</literal> clause
|
|
|
|
is simply the collation of the sort key. The collation to apply for a
|
|
|
|
function or operator call is derived from the arguments, as described
|
|
|
|
below. In addition to comparison operators, collations are taken into
|
|
|
|
account by functions that convert between lower and upper case
|
2017-10-09 03:44:17 +02:00
|
|
|
letters, such as <function>lower</function>, <function>upper</function>, and
|
|
|
|
<function>initcap</function>; by pattern matching operators; and by
|
|
|
|
<function>to_char</function> and related functions.
|
2011-02-08 22:04:18 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2011-03-08 23:10:34 +01:00
|
|
|
For a function or operator call, the collation that is derived by
|
|
|
|
examining the argument collations is used at run time for performing
|
|
|
|
the specified operation. If the result of the function or operator
|
|
|
|
call is of a collatable data type, the collation is also used at parse
|
|
|
|
time as the defined collation of the function or operator expression,
|
|
|
|
in case there is a surrounding expression that requires knowledge of
|
|
|
|
its collation.
|
2011-02-08 22:04:18 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2011-03-08 23:10:34 +01:00
|
|
|
The <firstterm>collation derivation</firstterm> of an expression can be
|
2011-02-08 22:04:18 +01:00
|
|
|
implicit or explicit. This distinction affects how collations are
|
|
|
|
combined when multiple different collations appear in an
|
2011-03-20 17:43:39 +01:00
|
|
|
expression. An explicit collation derivation occurs when a
|
2011-02-08 22:04:18 +01:00
|
|
|
<literal>COLLATE</literal> clause is used; all other collation
|
|
|
|
derivations are implicit. When multiple collations need to be
|
|
|
|
combined, for example in a function call, the following rules are
|
|
|
|
used:
|
|
|
|
|
|
|
|
<orderedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2011-03-08 23:10:34 +01:00
|
|
|
If any input expression has an explicit collation derivation, then
|
|
|
|
all explicitly derived collations among the input expressions must be
|
|
|
|
the same, otherwise an error is raised. If any explicitly
|
2011-02-08 22:04:18 +01:00
|
|
|
derived collation is present, that is the result of the
|
|
|
|
collation combination.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2011-03-08 23:10:34 +01:00
|
|
|
Otherwise, all input expressions must have the same implicit
|
2011-03-20 17:43:39 +01:00
|
|
|
collation derivation or the default collation. If any non-default
|
|
|
|
collation is present, that is the result of the collation combination.
|
|
|
|
Otherwise, the result is the default collation.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
If there are conflicting non-default implicit collations among the
|
|
|
|
input expressions, then the combination is deemed to have indeterminate
|
|
|
|
collation. This is not an error condition unless the particular
|
|
|
|
function being invoked requires knowledge of the collation it should
|
|
|
|
apply. If it does, an error will be raised at run-time.
|
2011-02-08 22:04:18 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</orderedlist>
|
|
|
|
|
2011-03-20 17:43:39 +01:00
|
|
|
For example, consider this table definition:
|
2011-02-08 22:04:18 +01:00
|
|
|
<programlisting>
|
|
|
|
CREATE TABLE test1 (
|
2011-03-20 17:43:39 +01:00
|
|
|
a text COLLATE "de_DE",
|
|
|
|
b text COLLATE "es_ES",
|
2011-02-08 22:04:18 +01:00
|
|
|
...
|
|
|
|
);
|
|
|
|
</programlisting>
|
|
|
|
|
|
|
|
Then in
|
|
|
|
<programlisting>
|
2011-03-20 17:43:39 +01:00
|
|
|
SELECT a < 'foo' FROM test1;
|
2011-02-08 22:04:18 +01:00
|
|
|
</programlisting>
|
2011-03-20 17:43:39 +01:00
|
|
|
the <literal><</literal> comparison is performed according to
|
|
|
|
<literal>de_DE</literal> rules, because the expression combines an
|
|
|
|
implicitly derived collation with the default collation. But in
|
2011-02-08 22:04:18 +01:00
|
|
|
<programlisting>
|
2011-03-20 17:43:39 +01:00
|
|
|
SELECT a < ('foo' COLLATE "fr_FR") FROM test1;
|
|
|
|
</programlisting>
|
|
|
|
the comparison is performed using <literal>fr_FR</literal> rules,
|
|
|
|
because the explicit collation derivation overrides the implicit one.
|
|
|
|
Furthermore, given
|
|
|
|
<programlisting>
|
|
|
|
SELECT a < b FROM test1;
|
|
|
|
</programlisting>
|
|
|
|
the parser cannot determine which collation to apply, since the
|
2017-10-09 03:44:17 +02:00
|
|
|
<structfield>a</structfield> and <structfield>b</structfield> columns have conflicting
|
2011-03-20 17:43:39 +01:00
|
|
|
implicit collations. Since the <literal><</literal> operator
|
|
|
|
does need to know which collation to use, this will result in an
|
|
|
|
error. The error can be resolved by attaching an explicit collation
|
|
|
|
specifier to either input expression, thus:
|
|
|
|
<programlisting>
|
|
|
|
SELECT a < b COLLATE "de_DE" FROM test1;
|
|
|
|
</programlisting>
|
|
|
|
or equivalently
|
|
|
|
<programlisting>
|
|
|
|
SELECT a COLLATE "de_DE" < b FROM test1;
|
|
|
|
</programlisting>
|
|
|
|
On the other hand, the structurally similar case
|
|
|
|
<programlisting>
|
|
|
|
SELECT a || b FROM test1;
|
|
|
|
</programlisting>
|
2017-10-09 03:44:17 +02:00
|
|
|
does not result in an error, because the <literal>||</literal> operator
|
2011-03-20 17:43:39 +01:00
|
|
|
does not care about collations: its result is the same regardless
|
|
|
|
of the collation.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The collation assigned to a function or operator's combined input
|
|
|
|
expressions is also considered to apply to the function or operator's
|
|
|
|
result, if the function or operator delivers a result of a collatable
|
|
|
|
data type. So, in
|
|
|
|
<programlisting>
|
|
|
|
SELECT * FROM test1 ORDER BY a || 'foo';
|
|
|
|
</programlisting>
|
|
|
|
the ordering will be done according to <literal>de_DE</literal> rules.
|
|
|
|
But this query:
|
|
|
|
<programlisting>
|
|
|
|
SELECT * FROM test1 ORDER BY a || b;
|
|
|
|
</programlisting>
|
2017-10-09 03:44:17 +02:00
|
|
|
results in an error, because even though the <literal>||</literal> operator
|
|
|
|
doesn't need to know a collation, the <literal>ORDER BY</literal> clause does.
|
2011-03-20 17:43:39 +01:00
|
|
|
As before, the conflict can be resolved with an explicit collation
|
|
|
|
specifier:
|
|
|
|
<programlisting>
|
|
|
|
SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR";
|
2011-02-08 22:04:18 +01:00
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
|
2017-01-18 18:00:00 +01:00
|
|
|
<sect2 id="collation-managing">
|
2011-02-08 22:04:18 +01:00
|
|
|
<title>Managing Collations</title>
|
|
|
|
|
|
|
|
<para>
|
2017-03-23 20:25:34 +01:00
|
|
|
A collation is an SQL schema object that maps an SQL name to locales
|
|
|
|
provided by libraries installed in the operating system. A collation
|
|
|
|
definition has a <firstterm>provider</firstterm> that specifies which
|
|
|
|
library supplies the locale data. One standard provider name
|
|
|
|
is <literal>libc</literal>, which uses the locales provided by the
|
2022-04-13 23:16:05 +02:00
|
|
|
operating system C library. These are the locales used by most tools
|
|
|
|
provided by the operating system. Another provider
|
2017-03-23 20:25:34 +01:00
|
|
|
is <literal>icu</literal>, which uses the external
|
2017-10-09 03:44:17 +02:00
|
|
|
ICU<indexterm><primary>ICU</primary></indexterm> library. ICU locales can only be
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
used if support for ICU was configured when PostgreSQL was built.
|
2017-03-23 20:25:34 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
A collation object provided by <literal>libc</literal> maps to a
|
|
|
|
combination of <symbol>LC_COLLATE</symbol> and <symbol>LC_CTYPE</symbol>
|
2017-09-22 19:51:01 +02:00
|
|
|
settings, as accepted by the <literal>setlocale()</literal> system library call. (As
|
2011-03-08 23:10:34 +01:00
|
|
|
the name would suggest, the main purpose of a collation is to set
|
2011-02-08 22:04:18 +01:00
|
|
|
<symbol>LC_COLLATE</symbol>, which controls the sort order. But
|
|
|
|
it is rarely necessary in practice to have an
|
|
|
|
<symbol>LC_CTYPE</symbol> setting that is different from
|
|
|
|
<symbol>LC_COLLATE</symbol>, so it is more convenient to collect
|
|
|
|
these under one concept than to create another infrastructure for
|
2017-03-23 20:25:34 +01:00
|
|
|
setting <symbol>LC_CTYPE</symbol> per expression.) Also,
|
|
|
|
a <literal>libc</literal> collation
|
2017-11-23 15:39:47 +01:00
|
|
|
is tied to a character set encoding (see <xref linkend="multibyte"/>).
|
2011-03-08 23:10:34 +01:00
|
|
|
The same collation name may exist for different encodings.
|
2011-02-08 22:04:18 +01:00
|
|
|
</para>
|
|
|
|
|
2017-03-23 20:25:34 +01:00
|
|
|
<para>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
A collation object provided by <literal>icu</literal> maps to a named
|
|
|
|
collator provided by the ICU library. ICU does not support
|
|
|
|
separate <quote>collate</quote> and <quote>ctype</quote> settings, so
|
|
|
|
they are always the same. Also, ICU collations are independent of the
|
|
|
|
encoding, so there is always only one ICU collation of a given name in
|
|
|
|
a database.
|
2017-03-23 20:25:34 +01:00
|
|
|
</para>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect3 id="collation-managing-standard">
|
2017-03-23 20:25:34 +01:00
|
|
|
<title>Standard Collations</title>
|
|
|
|
|
2011-02-08 22:04:18 +01:00
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
On all platforms, the collations named <literal>default</literal>,
|
|
|
|
<literal>C</literal>, and <literal>POSIX</literal> are available. Additional
|
2011-03-20 17:43:39 +01:00
|
|
|
collations may be available depending on operating system support.
|
2017-10-09 03:44:17 +02:00
|
|
|
The <literal>default</literal> collation selects the <symbol>LC_COLLATE</symbol>
|
2011-03-20 17:43:39 +01:00
|
|
|
and <symbol>LC_CTYPE</symbol> values specified at database creation time.
|
2017-10-09 03:44:17 +02:00
|
|
|
The <literal>C</literal> and <literal>POSIX</literal> collations both specify
|
|
|
|
<quote>traditional C</quote> behavior, in which only the ASCII letters
|
|
|
|
<quote><literal>A</literal></quote> through <quote><literal>Z</literal></quote>
|
2011-03-20 17:43:39 +01:00
|
|
|
are treated as letters, and sorting is done strictly by character
|
|
|
|
code byte values.
|
|
|
|
</para>
|
|
|
|
|
2023-05-18 19:37:55 +02:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
The <literal>C</literal> and <literal>POSIX</literal> locales may behave
|
|
|
|
differently depending on the database encoding.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2017-03-23 20:25:34 +01:00
|
|
|
<para>
|
2023-03-10 13:35:00 +01:00
|
|
|
Additionally, two SQL standard collation names are available:
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><literal>unicode</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
This collation sorts using the Unicode Collation Algorithm with the
|
|
|
|
Default Unicode Collation Element Table. It is available in all
|
|
|
|
encodings. ICU support is required to use this collation. (This
|
|
|
|
collation has the same behavior as the ICU root locale; see <xref
|
|
|
|
linkend="collation-managing-predefined-icu-und-x-icu"/>.)
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><literal>ucs_basic</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
This collation sorts by Unicode code point. It is only available for
|
|
|
|
encoding <literal>UTF8</literal>. (This collation has the same
|
|
|
|
behavior as the libc locale specification <literal>C</literal> in
|
|
|
|
<literal>UTF8</literal> encoding.)
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2017-03-23 20:25:34 +01:00
|
|
|
</para>
|
|
|
|
</sect3>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect3 id="collation-managing-predefined">
|
2017-03-23 20:25:34 +01:00
|
|
|
<title>Predefined Collations</title>
|
|
|
|
|
2011-03-20 17:43:39 +01:00
|
|
|
<para>
|
|
|
|
If the operating system provides support for using multiple locales
|
2017-10-09 03:44:17 +02:00
|
|
|
within a single program (<function>newlocale</function> and related functions),
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
or if support for ICU is configured,
|
2011-03-20 17:43:39 +01:00
|
|
|
then when a database cluster is initialized, <command>initdb</command>
|
2011-02-08 22:04:18 +01:00
|
|
|
populates the system catalog <literal>pg_collation</literal> with
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
collations based on all the locales it finds in the operating
|
2017-03-23 20:25:34 +01:00
|
|
|
system at the time.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
To inspect the currently available locales, use the query <literal>SELECT
|
|
|
|
* FROM pg_collation</literal>, or the command <command>\dOS+</command>
|
|
|
|
in <application>psql</application>.
|
|
|
|
</para>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect4 id="collation-managing-predefined-libc">
|
2019-09-08 10:26:35 +02:00
|
|
|
<title>libc Collations</title>
|
2017-03-23 20:25:34 +01:00
|
|
|
|
|
|
|
<para>
|
|
|
|
For example, the operating system might
|
2011-02-08 22:04:18 +01:00
|
|
|
provide a locale named <literal>de_DE.utf8</literal>.
|
|
|
|
<command>initdb</command> would then create a collation named
|
|
|
|
<literal>de_DE.utf8</literal> for encoding <literal>UTF8</literal>
|
|
|
|
that has both <symbol>LC_COLLATE</symbol> and
|
|
|
|
<symbol>LC_CTYPE</symbol> set to <literal>de_DE.utf8</literal>.
|
|
|
|
It will also create a collation with the <literal>.utf8</literal>
|
|
|
|
tag stripped off the name. So you could also use the collation
|
|
|
|
under the name <literal>de_DE</literal>, which is less cumbersome
|
|
|
|
to write and makes the name less encoding-dependent. Note that,
|
|
|
|
nevertheless, the initial set of collation names is
|
|
|
|
platform-dependent.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2017-03-23 20:25:34 +01:00
|
|
|
The default set of collations provided by <literal>libc</literal> map
|
|
|
|
directly to the locales installed in the operating system, which can be
|
|
|
|
listed using the command <literal>locale -a</literal>. In case
|
|
|
|
a <literal>libc</literal> collation is needed that has different values
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
for <symbol>LC_COLLATE</symbol> and <symbol>LC_CTYPE</symbol>, or if new
|
2017-03-23 20:25:34 +01:00
|
|
|
locales are installed in the operating system after the database system
|
|
|
|
was initialized, then a new collation may be created using
|
2017-11-23 15:39:47 +01:00
|
|
|
the <xref linkend="sql-createcollation"/> command.
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
New operating system locales can also be imported en masse using
|
|
|
|
the <link linkend="functions-admin-collation"><function>pg_import_system_collations()</function></link> function.
|
2011-03-08 23:10:34 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Within any particular database, only collations that use that
|
|
|
|
database's encoding are of interest. Other entries in
|
|
|
|
<literal>pg_collation</literal> are ignored. Thus, a stripped collation
|
|
|
|
name such as <literal>de_DE</literal> can be considered unique
|
|
|
|
within a given database even though it would not be unique globally.
|
2012-08-14 18:36:35 +02:00
|
|
|
Use of the stripped collation names is recommended, since it will
|
2021-02-24 08:13:17 +01:00
|
|
|
make one fewer thing you need to change if you decide to change to
|
2017-10-09 03:44:17 +02:00
|
|
|
another database encoding. Note however that the <literal>default</literal>,
|
|
|
|
<literal>C</literal>, and <literal>POSIX</literal> collations can be used regardless of
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
the database encoding.
|
2011-03-20 17:43:39 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<productname>PostgreSQL</productname> considers distinct collation
|
|
|
|
objects to be incompatible even when they have identical properties.
|
|
|
|
Thus for example,
|
|
|
|
<programlisting>
|
|
|
|
SELECT a COLLATE "C" < b COLLATE "POSIX" FROM test1;
|
|
|
|
</programlisting>
|
2017-10-09 03:44:17 +02:00
|
|
|
will draw an error even though the <literal>C</literal> and <literal>POSIX</literal>
|
2011-03-20 17:43:39 +01:00
|
|
|
collations have identical behaviors. Mixing stripped and non-stripped
|
|
|
|
collation names is therefore not recommended.
|
2011-02-08 22:04:18 +01:00
|
|
|
</para>
|
2017-03-23 20:25:34 +01:00
|
|
|
</sect4>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect4 id="collation-managing-predefined-icu">
|
2019-09-08 10:26:35 +02:00
|
|
|
<title>ICU Collations</title>
|
2017-03-23 20:25:34 +01:00
|
|
|
|
|
|
|
<para>
|
2017-09-22 19:51:01 +02:00
|
|
|
With ICU, it is not sensible to enumerate all possible locale names. ICU
|
|
|
|
uses a particular naming system for locales, but there are many more ways
|
|
|
|
to name a locale than there are actually distinct locales.
|
|
|
|
<command>initdb</command> uses the ICU APIs to extract a set of distinct
|
|
|
|
locales to populate the initial set of collations. Collations provided by
|
|
|
|
ICU are created in the SQL environment with names in BCP 47 language tag
|
2017-03-23 20:25:34 +01:00
|
|
|
format, with a <quote>private use</quote>
|
|
|
|
extension <literal>-x-icu</literal> appended, to distinguish them from
|
2017-09-22 19:51:01 +02:00
|
|
|
libc locales.
|
2017-03-23 20:25:34 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2017-09-22 19:51:01 +02:00
|
|
|
Here are some example collations that might be created:
|
2017-03-23 20:25:34 +01:00
|
|
|
|
|
|
|
<variablelist>
|
2023-01-09 21:08:24 +01:00
|
|
|
<varlistentry id="collation-managing-predefined-icu-de-x-icu">
|
2017-03-23 20:25:34 +01:00
|
|
|
<term><literal>de-x-icu</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>German collation, default variant</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<varlistentry id="collation-managing-predefined-icu-de-at-x-icu">
|
2017-03-23 20:25:34 +01:00
|
|
|
<term><literal>de-AT-x-icu</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>German collation for Austria, default variant</para>
|
|
|
|
<para>
|
2017-08-21 15:17:06 +02:00
|
|
|
(There are also, say, <literal>de-DE-x-icu</literal>
|
|
|
|
or <literal>de-CH-x-icu</literal>, but as of this writing, they are
|
|
|
|
equivalent to <literal>de-x-icu</literal>.)
|
2017-03-23 20:25:34 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<varlistentry id="collation-managing-predefined-icu-und-x-icu">
|
2017-03-23 20:25:34 +01:00
|
|
|
<term><literal>und-x-icu</literal> (for <quote>undefined</quote>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
ICU <quote>root</quote> collation. Use this to get a reasonable
|
|
|
|
language-agnostic sort order.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
Some (less frequently used) encodings are not supported by ICU. When the
|
|
|
|
database encoding is one of these, ICU collation entries
|
|
|
|
in <literal>pg_collation</literal> are ignored. Attempting to use one
|
|
|
|
will draw an error along the lines of <quote>collation "de-x-icu" for
|
2017-10-09 03:44:17 +02:00
|
|
|
encoding "WIN874" does not exist</quote>.
|
2017-03-23 20:25:34 +01:00
|
|
|
</para>
|
2017-09-22 19:51:01 +02:00
|
|
|
</sect4>
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
<sect3 id="collation-create">
|
|
|
|
<title>Creating New Collation Objects</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If the standard and predefined collations are not sufficient, users can
|
|
|
|
create their own collation objects using the SQL
|
2017-11-23 15:39:47 +01:00
|
|
|
command <xref linkend="sql-createcollation"/>.
|
2017-09-22 19:51:01 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The standard and predefined collations are in the
|
|
|
|
schema <literal>pg_catalog</literal>, like all predefined objects.
|
|
|
|
User-defined collations should be created in user schemas. This also
|
|
|
|
ensures that they are saved by <command>pg_dump</command>.
|
|
|
|
</para>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect4 id="collation-managing-create-libc">
|
2019-09-08 10:26:35 +02:00
|
|
|
<title>libc Collations</title>
|
2017-09-22 19:51:01 +02:00
|
|
|
|
|
|
|
<para>
|
|
|
|
New libc collations can be created like this:
|
|
|
|
<programlisting>
|
|
|
|
CREATE COLLATION german (provider = libc, locale = 'de_DE');
|
|
|
|
</programlisting>
|
|
|
|
The exact values that are acceptable for the <literal>locale</literal>
|
|
|
|
clause in this command depend on the operating system. On Unix-like
|
|
|
|
systems, the command <literal>locale -a</literal> will show a list.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Since the predefined libc collations already include all collations
|
|
|
|
defined in the operating system when the database instance is
|
|
|
|
initialized, it is not often necessary to manually create new ones.
|
|
|
|
Reasons might be if a different naming system is desired (in which case
|
2017-11-23 15:39:47 +01:00
|
|
|
see also <xref linkend="collation-copy"/>) or if the operating system has
|
2017-09-22 19:51:01 +02:00
|
|
|
been upgraded to provide new locale definitions (in which case see
|
|
|
|
also <link linkend="functions-admin-collation"><function>pg_import_system_collations()</function></link>).
|
|
|
|
</para>
|
|
|
|
</sect4>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect4 id="collation-managing-create-icu">
|
2019-09-08 10:26:35 +02:00
|
|
|
<title>ICU Collations</title>
|
2017-08-21 17:22:00 +02:00
|
|
|
|
2023-05-18 19:37:55 +02:00
|
|
|
<para>
|
|
|
|
ICU collations can be created like:
|
2017-08-21 17:22:00 +02:00
|
|
|
|
2023-05-18 19:37:55 +02:00
|
|
|
<programlisting>
|
|
|
|
CREATE COLLATION german (provider = icu, locale = 'de-DE');
|
|
|
|
</programlisting>
|
2017-09-22 19:51:01 +02:00
|
|
|
|
2023-05-18 19:37:55 +02:00
|
|
|
ICU locales are specified as a BCP 47 <link
|
|
|
|
linkend="icu-language-tag">Language Tag</link>, but can also accept most
|
|
|
|
libc-style locale names. If possible, libc-style locale names are
|
|
|
|
transformed into language tags.
|
|
|
|
</para>
|
2017-09-22 19:51:01 +02:00
|
|
|
<para>
|
2023-05-18 19:37:55 +02:00
|
|
|
New ICU collations can customize collation behavior extensively by
|
2023-05-25 12:49:26 +02:00
|
|
|
including collation attributes in the language tag. See <xref
|
2023-05-18 19:37:55 +02:00
|
|
|
linkend="icu-custom-collations"/> for details and examples.
|
2017-09-22 19:51:01 +02:00
|
|
|
</para>
|
2017-03-23 20:25:34 +01:00
|
|
|
</sect4>
|
2017-09-22 19:51:01 +02:00
|
|
|
<sect4 id="collation-copy">
|
2017-03-23 20:25:34 +01:00
|
|
|
<title>Copying Collations</title>
|
|
|
|
|
|
|
|
<para>
|
2017-11-23 15:39:47 +01:00
|
|
|
The command <xref linkend="sql-createcollation"/> can also be used to
|
2017-03-23 20:25:34 +01:00
|
|
|
create a new collation from an existing collation, which can be useful to
|
|
|
|
be able to use operating-system-independent collation names in
|
|
|
|
applications, create compatibility names, or use an ICU-provided collation
|
|
|
|
under a more readable name. For example:
|
|
|
|
<programlisting>
|
|
|
|
CREATE COLLATION german FROM "de_DE";
|
|
|
|
CREATE COLLATION french FROM "fr-x-icu";
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
2017-09-22 19:51:01 +02:00
|
|
|
</sect4>
|
2017-03-23 21:59:24 +01:00
|
|
|
</sect3>
|
2019-03-22 12:09:32 +01:00
|
|
|
|
|
|
|
<sect3 id="collation-nondeterministic">
|
2019-09-13 16:21:20 +02:00
|
|
|
<title>Nondeterministic Collations</title>
|
2019-03-22 12:09:32 +01:00
|
|
|
|
|
|
|
<para>
|
|
|
|
A collation is either <firstterm>deterministic</firstterm> or
|
|
|
|
<firstterm>nondeterministic</firstterm>. A deterministic collation uses
|
|
|
|
deterministic comparisons, which means that it considers strings to be
|
|
|
|
equal only if they consist of the same byte sequence. Nondeterministic
|
|
|
|
comparison may determine strings to be equal even if they consist of
|
|
|
|
different bytes. Typical situations include case-insensitive comparison,
|
2019-05-26 14:58:18 +02:00
|
|
|
accent-insensitive comparison, as well as comparison of strings in
|
2019-03-22 12:09:32 +01:00
|
|
|
different Unicode normal forms. It is up to the collation provider to
|
|
|
|
actually implement such insensitive comparisons; the deterministic flag
|
|
|
|
only determines whether ties are to be broken using bytewise comparison.
|
2019-10-13 22:10:38 +02:00
|
|
|
See also <ulink url="https://www.unicode.org/reports/tr10">Unicode Technical
|
2019-03-22 12:09:32 +01:00
|
|
|
Standard 10</ulink> for more information on the terminology.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
To create a nondeterministic collation, specify the property
|
|
|
|
<literal>deterministic = false</literal> to <command>CREATE
|
|
|
|
COLLATION</command>, for example:
|
|
|
|
<programlisting>
|
|
|
|
CREATE COLLATION ndcoll (provider = icu, locale = 'und', deterministic = false);
|
|
|
|
</programlisting>
|
|
|
|
This example would use the standard Unicode collation in a
|
|
|
|
nondeterministic way. In particular, this would allow strings in
|
|
|
|
different normal forms to be compared correctly. More interesting
|
|
|
|
examples make use of the ICU customization facilities explained above.
|
|
|
|
For example:
|
|
|
|
<programlisting>
|
|
|
|
CREATE COLLATION case_insensitive (provider = icu, locale = 'und-u-ks-level2', deterministic = false);
|
|
|
|
CREATE COLLATION ignore_accents (provider = icu, locale = 'und-u-ks-level1-kc-true', deterministic = false);
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
All standard and predefined collations are deterministic, all
|
|
|
|
user-defined collations are deterministic by default. While
|
|
|
|
nondeterministic collations give a more <quote>correct</quote> behavior,
|
|
|
|
especially when considering the full power of Unicode and its many
|
|
|
|
special cases, they also have some drawbacks. Foremost, their use leads
|
Add deduplication to nbtree.
Deduplication reduces the storage overhead of duplicates in indexes that
use the standard nbtree index access method. The deduplication process
is applied lazily, after the point where opportunistic deletion of
LP_DEAD-marked index tuples occurs. Deduplication is only applied at
the point where a leaf page split would otherwise be required. New
posting list tuples are formed by merging together existing duplicate
tuples. The physical representation of the items on an nbtree leaf page
is made more space efficient by deduplication, but the logical contents
of the page are not changed. Even unique indexes make use of
deduplication as a way of controlling bloat from duplicates whose TIDs
point to different versions of the same logical table row.
The lazy approach taken by nbtree has significant advantages over a GIN
style eager approach. Most individual inserts of index tuples have
exactly the same overhead as before. The extra overhead of
deduplication is amortized across insertions, just like the overhead of
page splits. The key space of indexes works in the same way as it has
since commit dd299df8 (the commit that made heap TID a tiebreaker
column).
Testing has shown that nbtree deduplication can generally make indexes
with about 10 or 15 tuples for each distinct key value about 2.5X - 4X
smaller, even with single column integer indexes (e.g., an index on a
referencing column that accompanies a foreign key). The final size of
single column nbtree indexes comes close to the final size of a similar
contrib/btree_gin index, at least in cases where GIN's posting list
compression isn't very effective. This can significantly improve
transaction throughput, and significantly reduce the cost of vacuuming
indexes.
A new index storage parameter (deduplicate_items) controls the use of
deduplication. The default setting is 'on', so all new B-Tree indexes
automatically use deduplication where possible. This decision will be
reviewed at the end of the Postgres 13 beta period.
There is a regression of approximately 2% of transaction throughput with
synthetic workloads that consist of append-only inserts into a table
with several non-unique indexes, where all indexes have few or no
repeated values. The underlying issue is that cycles are wasted on
unsuccessful attempts at deduplicating items in non-unique indexes.
There doesn't seem to be a way around it short of disabling
deduplication entirely. Note that deduplication of items in unique
indexes is fairly well targeted in general, which avoids the problem
there (we can use a special heuristic to trigger deduplication passes in
unique indexes, since we're specifically targeting "version bloat").
Bump XLOG_PAGE_MAGIC because xl_btree_vacuum changed.
No bump in BTREE_VERSION, since the representation of posting list
tuples works in a way that's backwards compatible with version 4 indexes
(i.e. indexes built on PostgreSQL 12). However, users must still
REINDEX a pg_upgrade'd index to use deduplication, regardless of the
Postgres version they've upgraded from. This is the only way to set the
new nbtree metapage flag indicating that deduplication is generally
safe.
Author: Anastasia Lubennikova, Peter Geoghegan
Reviewed-By: Peter Geoghegan, Heikki Linnakangas
Discussion:
https://postgr.es/m/55E4051B.7020209@postgrespro.ru
https://postgr.es/m/4ab6e2db-bcee-f4cf-0916-3a06e6ccbb55@postgrespro.ru
2020-02-26 22:05:30 +01:00
|
|
|
to a performance penalty. Note, in particular, that B-tree cannot use
|
|
|
|
deduplication with indexes that use a nondeterministic collation. Also,
|
|
|
|
certain operations are not possible with nondeterministic collations,
|
|
|
|
such as pattern matching operations. Therefore, they should be used
|
|
|
|
only in cases where they are specifically wanted.
|
2019-03-22 12:09:32 +01:00
|
|
|
</para>
|
2020-03-26 08:14:00 +01:00
|
|
|
|
|
|
|
<tip>
|
|
|
|
<para>
|
|
|
|
To deal with text in different Unicode normalization forms, it is also
|
|
|
|
an option to use the functions/expressions
|
|
|
|
<function>normalize</function> and <literal>is normalized</literal> to
|
|
|
|
preprocess or check the strings, instead of using nondeterministic
|
|
|
|
collations. There are different trade-offs for each approach.
|
|
|
|
</para>
|
|
|
|
</tip>
|
2019-03-22 12:09:32 +01:00
|
|
|
</sect3>
|
2011-02-08 22:04:18 +01:00
|
|
|
</sect2>
|
2023-05-18 19:37:55 +02:00
|
|
|
<sect2 id="icu-custom-collations">
|
|
|
|
<title>ICU Custom Collations</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
ICU allows extensive control over collation behavior by defining new
|
|
|
|
collations with collation settings as a part of the language tag. These
|
|
|
|
settings can modify the collation order to suit a variety of needs. For
|
|
|
|
instance:
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
-- ignore differences in accents and case
|
|
|
|
CREATE COLLATION ignore_accent_case (PROVIDER = icu, DETERMINISTIC = false, LOCALE = 'und-u-ks-level1');
|
|
|
|
SELECT 'Å' = 'A' COLLATE ignore_accent_case; -- true
|
|
|
|
SELECT 'z' = 'Z' COLLATE ignore_accent_case; -- true
|
|
|
|
|
|
|
|
-- upper case letters sort before lower case.
|
|
|
|
CREATE COLLATION upper_first (PROVIDER=icu, LOCALE = 'und-u-kf-upper');
|
|
|
|
SELECT 'B' < 'b' COLLATE upper_first; -- true
|
|
|
|
|
|
|
|
-- treat digits numerically and ignore punctuation
|
|
|
|
CREATE COLLATION num_ignore_punct (PROVIDER = icu, DETERMINISTIC = false, LOCALE = 'und-u-ka-shifted-kn');
|
|
|
|
SELECT 'id-45' < 'id-123' COLLATE num_ignore_punct; -- true
|
|
|
|
SELECT 'w;x*y-z' = 'wxyz' COLLATE num_ignore_punct; -- true
|
|
|
|
</programlisting>
|
|
|
|
|
|
|
|
Many of the available options are described in <xref
|
|
|
|
linkend="icu-collation-settings"/>, or see <xref
|
|
|
|
linkend="icu-external-references"/> for more details.
|
|
|
|
</para>
|
|
|
|
<sect3 id="icu-collation-comparison-levels">
|
|
|
|
<title>ICU Comparison Levels</title>
|
|
|
|
<para>
|
|
|
|
Comparison of two strings (collation) in ICU is determined by a
|
|
|
|
multi-level process, where textual features are grouped into
|
|
|
|
"levels". Treatment of each level is controlled by the <link
|
|
|
|
linkend="icu-collation-settings-table">collation settings</link>. Higher
|
|
|
|
levels correspond to finer textual features.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<table id="icu-collation-levels">
|
|
|
|
<title>ICU Collation Levels</title>
|
2023-05-18 20:04:30 +02:00
|
|
|
<tgroup cols="8">
|
2023-05-21 17:21:19 +02:00
|
|
|
<colspec colname="col1" colwidth="1*"/>
|
|
|
|
<colspec colname="col2" colwidth="1.25*"/>
|
|
|
|
<colspec colname="col3" colwidth="1*"/>
|
|
|
|
<colspec colname="col4" colwidth="1*"/>
|
|
|
|
<colspec colname="col5" colwidth="1*"/>
|
|
|
|
<colspec colname="col6" colwidth="1*"/>
|
|
|
|
<colspec colname="col7" colwidth="1*"/>
|
|
|
|
<colspec colname="col8" colwidth="1*"/>
|
2023-05-18 19:37:55 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Level</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
<entry><literal>'f' = 'f'</literal></entry>
|
|
|
|
<entry><literal>'ab' = U&'a\2063b'</literal></entry>
|
|
|
|
<entry><literal>'x-y' = 'x_y'</literal></entry>
|
|
|
|
<entry><literal>'g' = 'G'</literal></entry>
|
|
|
|
<entry><literal>'n' = 'ñ'</literal></entry>
|
|
|
|
<entry><literal>'y' = 'z'</literal></entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry>level1</entry>
|
|
|
|
<entry>Base Character</entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>level2</entry>
|
|
|
|
<entry>Accents</entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>level3</entry>
|
|
|
|
<entry>Case/Variants</entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>level4</entry>
|
|
|
|
<entry>Punctuation</entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>identic</entry>
|
|
|
|
<entry>All</entry>
|
|
|
|
<entry><literal>true</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
The above table shows which textual feature differences are
|
|
|
|
considered significant when determining equality at the given level. The
|
|
|
|
unicode character <literal>U+2063</literal> is an invisible separator,
|
|
|
|
and as seen in the table, is ignored for at all levels of comparison less
|
|
|
|
than <literal>identic</literal>.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
At every level, even with full normalization off, basic normalization is
|
|
|
|
performed. For example, <literal>'á'</literal> may be composed of the
|
|
|
|
code points <literal>U&'\0061\0301'</literal> or the single code
|
|
|
|
point <literal>U&'\00E1'</literal>, and those sequences will be
|
|
|
|
considered equal even at the <literal>identic</literal> level. To treat
|
|
|
|
any difference in code point representation as distinct, use a collation
|
|
|
|
created with <symbol>DETERMINISTIC</symbol> set to
|
|
|
|
<literal>true</literal>.
|
|
|
|
</para>
|
|
|
|
<sect4 id="icu-collation-level-examples">
|
|
|
|
<title>Collation Level Examples</title>
|
|
|
|
<para>
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
CREATE COLLATION level3 (PROVIDER=icu, DETERMINISTIC=false, LOCALE='und-u-ka-shifted-ks-level3');
|
|
|
|
CREATE COLLATION level4 (PROVIDER=icu, DETERMINISTIC=false, LOCALE='und-u-ka-shifted-ks-level4');
|
|
|
|
CREATE COLLATION identic (PROVIDER=icu, DETERMINISTIC=false, LOCALE='und-u-ka-shifted-ks-identic');
|
|
|
|
|
|
|
|
-- invisible separator ignored at all levels except identic
|
|
|
|
SELECT 'ab' = U&'a\2063b' COLLATE level4; -- true
|
|
|
|
SELECT 'ab' = U&'a\2063b' COLLATE identic; -- false
|
|
|
|
|
|
|
|
-- punctuation ignored at level3 but not at level 4
|
|
|
|
SELECT 'x-y' = 'x_y' COLLATE level3; -- true
|
|
|
|
SELECT 'x-y' = 'x_y' COLLATE level4; -- false
|
|
|
|
</programlisting>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
</sect4>
|
|
|
|
</sect3>
|
|
|
|
<sect3 id="icu-collation-settings">
|
|
|
|
<title>Collation Settings for an ICU Locale</title>
|
|
|
|
<para>
|
|
|
|
<table id="icu-collation-settings-table">
|
|
|
|
<title>ICU Collation Settings</title>
|
|
|
|
<tgroup cols="4">
|
2023-05-21 17:21:19 +02:00
|
|
|
<colspec colname="col1" colwidth="1*"/>
|
|
|
|
<colspec colname="col2" colwidth="2*"/>
|
|
|
|
<colspec colname="col3" colwidth="2*"/>
|
|
|
|
<colspec colname="col4" colwidth="5*"/>
|
2023-05-18 19:37:55 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Key</entry>
|
|
|
|
<entry>Values</entry>
|
|
|
|
<entry>Default</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><literal>ks</literal></entry>
|
|
|
|
<entry><literal>level1</literal>, <literal>level2</literal>, <literal>level3</literal>, <literal>level4</literal>, <literal>identic</literal></entry>
|
|
|
|
<entry><literal>level3</literal></entry>
|
|
|
|
<entry>
|
|
|
|
Sensitivity (or "strength") when determining equality, with
|
|
|
|
<literal>level1</literal> the least sensitive to differences and
|
|
|
|
<literal>identic</literal> the most sensitive to differences. See
|
|
|
|
<xref linkend="icu-collation-levels"/> for details.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>ka</literal></entry>
|
|
|
|
<entry><literal>noignore</literal>, <literal>shifted</literal></entry>
|
|
|
|
<entry><literal>noignore</literal></entry>
|
|
|
|
<entry>
|
|
|
|
If set to <literal>shifted</literal>, causes some characters
|
|
|
|
(e.g. punctuation or space) to be ignored in comparison. Key
|
|
|
|
<literal>ks</literal> must be set to <literal>level3</literal> or
|
|
|
|
lower to take effect. Set key <literal>kv</literal> to control which
|
|
|
|
character classes are ignored.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>kb</literal></entry>
|
|
|
|
<entry><literal>true</literal>, <literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry>
|
|
|
|
Backwards comparison for the level 2 differences. For example,
|
|
|
|
locale <literal>und-u-kb</literal> sorts <literal>'àe'</literal>
|
|
|
|
before <literal>'aé'</literal>.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>kk</literal></entry>
|
|
|
|
<entry><literal>true</literal>, <literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry>
|
|
|
|
<para>
|
|
|
|
Enable full normalization; may affect performance. Basic
|
|
|
|
normalization is performed even when set to
|
|
|
|
<literal>false</literal>. Locales for languages that require full
|
|
|
|
normalization typically enable it by default.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Full normalization is important in some cases, such as when
|
2023-05-21 17:21:19 +02:00
|
|
|
multiple accents are applied to a single character. For example,
|
|
|
|
the code point sequences <literal>U&'\0065\0323\0302'</literal>
|
|
|
|
and <literal>U&'\0065\0302\0323'</literal> represent
|
|
|
|
an <literal>e</literal> with circumflex and dot-below accents
|
|
|
|
applied in different orders. With full normalization
|
2023-05-18 19:37:55 +02:00
|
|
|
on, these code point sequences are treated as equal; otherwise they
|
|
|
|
are unequal.
|
|
|
|
</para>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>kc</literal></entry>
|
|
|
|
<entry><literal>true</literal>, <literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry>
|
|
|
|
<para>
|
|
|
|
Separates case into a "level 2.5" that falls between accents and
|
|
|
|
other level 3 features.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
If set to <literal>true</literal> and <literal>ks</literal> is set
|
|
|
|
to <literal>level1</literal>, will ignore accents but take case
|
|
|
|
into account.
|
|
|
|
</para>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>kf</literal></entry>
|
|
|
|
<entry>
|
|
|
|
<literal>upper</literal>, <literal>lower</literal>,
|
|
|
|
<literal>false</literal>
|
|
|
|
</entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry>
|
|
|
|
If set to <literal>upper</literal>, upper case sorts before lower
|
|
|
|
case. If set to <literal>lower</literal>, lower case sorts before
|
|
|
|
upper case. If set to <literal>false</literal>, the sort depends on
|
|
|
|
the rules of the locale.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>kn</literal></entry>
|
|
|
|
<entry><literal>true</literal>, <literal>false</literal></entry>
|
|
|
|
<entry><literal>false</literal></entry>
|
|
|
|
<entry>
|
|
|
|
If set to <literal>true</literal>, numbers within a string are
|
|
|
|
treated as a single numeric value rather than a sequence of
|
|
|
|
digits. For example, <literal>'id-45'</literal> sorts before
|
|
|
|
<literal>'id-123'</literal>.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>kr</literal></entry>
|
|
|
|
<entry>
|
|
|
|
<literal>space</literal>, <literal>punct</literal>,
|
|
|
|
<literal>symbol</literal>, <literal>currency</literal>,
|
|
|
|
<literal>digit</literal>, <replaceable>script-id</replaceable>
|
|
|
|
</entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
<para>
|
|
|
|
Set to one or more of the valid values, or any BCP 47
|
|
|
|
<replaceable>script-id</replaceable>, e.g. <literal>latn</literal>
|
|
|
|
("Latin") or <literal>grek</literal> ("Greek"). Multiple values are
|
|
|
|
separated by "<literal>-</literal>".
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Redefines the ordering of classes of characters; those characters
|
|
|
|
belonging to a class earlier in the list sort before characters
|
|
|
|
belonging to a class later in the list. For instance, the value
|
|
|
|
<literal>digit-currency-space</literal> (as part of a language tag
|
|
|
|
like <literal>und-u-kr-digit-currency-space</literal>) sorts
|
|
|
|
punctuation before digits and spaces.
|
|
|
|
</para>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>kv</literal></entry>
|
|
|
|
<entry>
|
|
|
|
<literal>space</literal>, <literal>punct</literal>,
|
|
|
|
<literal>symbol</literal>, <literal>currency</literal>
|
|
|
|
</entry>
|
|
|
|
<entry><literal>punct</literal></entry>
|
|
|
|
<entry>
|
|
|
|
Classes of characters ignored during comparison at level 3. Setting
|
|
|
|
to a later value includes earlier values;
|
|
|
|
e.g. <literal>symbol</literal> also includes
|
|
|
|
<literal>punct</literal> and <literal>space</literal> in the
|
|
|
|
characters to be ignored. Key <literal>ka</literal> must be set to
|
|
|
|
<literal>shifted</literal> and key <literal>ks</literal> must be set
|
|
|
|
to <literal>level3</literal> or lower to take effect.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>co</literal></entry>
|
|
|
|
<entry><literal>emoji</literal>, <literal>phonebk</literal>, <literal>standard</literal>, <replaceable>...</replaceable></entry>
|
|
|
|
<entry><literal>standard</literal></entry>
|
|
|
|
<entry>
|
|
|
|
Collation type. See <xref linkend="icu-external-references"/> for additional options and details.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
Defaults may depend on locale. The above table is not meant to be
|
|
|
|
complete. See <xref linkend="icu-external-references"/> for additional
|
|
|
|
options and details.
|
|
|
|
</para>
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
For many collation settings, you must create the collation with
|
|
|
|
<option>DETERMINISTIC</option> set to <literal>false</literal> for the
|
|
|
|
setting to have the desired effect (see <xref
|
|
|
|
linkend="collation-nondeterministic"/>). Additionally, some settings
|
|
|
|
only take effect when the key <literal>ka</literal> is set to
|
|
|
|
<literal>shifted</literal> (see <xref
|
|
|
|
linkend="icu-collation-settings-table"/>).
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</sect3>
|
|
|
|
<sect3 id="icu-locale-examples">
|
|
|
|
<title>Examples</title>
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry id="collation-managing-create-icu-de-u-co-phonebk-x-icu">
|
|
|
|
<term><literal>CREATE COLLATION "de-u-co-phonebk-x-icu" (provider = icu, locale = 'de-u-co-phonebk');</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>German collation with phone book collation type</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="collation-managing-create-icu-und-u-co-emoji-x-icu">
|
|
|
|
<term><literal>CREATE COLLATION "und-u-co-emoji-x-icu" (provider = icu, locale = 'und-u-co-emoji');</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Root collation with Emoji collation type, per Unicode Technical Standard #51
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="collation-managing-create-icu-en-u-kr-grek-latn">
|
|
|
|
<term><literal>CREATE COLLATION latinlast (provider = icu, locale = 'en-u-kr-grek-latn');</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sort Greek letters before Latin ones. (The default is Latin before Greek.)
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="collation-managing-create-icu-en-u-kf-upper">
|
|
|
|
<term><literal>CREATE COLLATION upperfirst (provider = icu, locale = 'en-u-kf-upper');</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Sort upper-case letters before lower-case letters. (The default is
|
|
|
|
lower-case letters first.)
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="collation-managing-create-icu-en-u-kf-upper-kr-grek-latn">
|
|
|
|
<term><literal>CREATE COLLATION special (provider = icu, locale = 'en-u-kf-upper-kr-grek-latn');</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Combines both of the above options.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</sect3>
|
|
|
|
<sect3 id="icu-external-references">
|
|
|
|
<title>External References for ICU</title>
|
|
|
|
<para>
|
|
|
|
This section (<xref linkend="icu-custom-collations"/>) is only a brief
|
|
|
|
overview of ICU behavior and language tags. Refer to the following
|
|
|
|
documents for technical details, additional options, and new behavior:
|
|
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<ulink
|
|
|
|
url="https://www.unicode.org/reports/tr35/tr35-collation.html">Unicode
|
|
|
|
Technical Standard #35</ulink>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<ulink url="https://tools.ietf.org/html/bcp47">BCP 47</ulink>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<ulink url="https://github.com/unicode-org/cldr/blob/master/common/bcp47/collation.xml">CLDR
|
|
|
|
repository</ulink>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<ulink url="https://unicode-org.github.io/icu/userguide/locale/"></ulink>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<ulink url="https://unicode-org.github.io/icu/userguide/collation/api.html"></ulink>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
2011-02-08 22:04:18 +01:00
|
|
|
</sect1>
|
|
|
|
|
2003-03-24 15:32:51 +01:00
|
|
|
<sect1 id="multibyte">
|
|
|
|
<title>Character Set Support</title>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2017-10-09 03:44:17 +02:00
|
|
|
<indexterm zone="multibyte"><primary>character set</primary></indexterm>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2003-03-24 15:32:51 +01:00
|
|
|
<para>
|
|
|
|
The character set support in <productname>PostgreSQL</productname>
|
2007-09-29 00:25:49 +02:00
|
|
|
allows you to store text in a variety of character sets (also called
|
|
|
|
encodings), including
|
2003-03-24 15:32:51 +01:00
|
|
|
single-byte character sets such as the ISO 8859 series and
|
2017-10-09 03:44:17 +02:00
|
|
|
multiple-byte character sets such as <acronym>EUC</acronym> (Extended Unix
|
2006-07-28 17:33:17 +02:00
|
|
|
Code), UTF-8, and Mule internal code. All supported character sets
|
|
|
|
can be used transparently by clients, but a few are not supported
|
|
|
|
for use within the server (that is, as a server-side encoding).
|
|
|
|
The default character set is selected while
|
2003-03-24 15:32:51 +01:00
|
|
|
initializing your <productname>PostgreSQL</productname> database
|
2017-10-09 03:44:17 +02:00
|
|
|
cluster using <command>initdb</command>. It can be overridden when you
|
2006-07-28 17:33:17 +02:00
|
|
|
create a database, so you can have multiple
|
2003-03-24 15:32:51 +01:00
|
|
|
databases each with a different character set.
|
|
|
|
</para>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2007-09-29 00:25:49 +02:00
|
|
|
<para>
|
2008-09-23 11:20:39 +02:00
|
|
|
An important restriction, however, is that each database's character set
|
2017-10-09 03:44:17 +02:00
|
|
|
must be compatible with the database's <envar>LC_CTYPE</envar> (character
|
|
|
|
classification) and <envar>LC_COLLATE</envar> (string sort order) locale
|
|
|
|
settings. For <literal>C</literal> or
|
|
|
|
<literal>POSIX</literal> locale, any character set is allowed, but for other
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
libc-provided locales there is only one character set that will work
|
|
|
|
correctly.
|
2009-05-06 18:15:21 +02:00
|
|
|
(On Windows, however, UTF-8 encoding can be used with any locale.)
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
If you have ICU support configured, ICU-provided locales can be used
|
|
|
|
with most but not all server-side encodings.
|
2007-09-29 00:25:49 +02:00
|
|
|
</para>
|
|
|
|
|
2004-03-23 03:47:35 +01:00
|
|
|
<sect2 id="multibyte-charset-supported">
|
2003-03-24 15:32:51 +01:00
|
|
|
<title>Supported Character Sets</title>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2002-07-24 07:51:56 +02:00
|
|
|
<para>
|
2017-11-23 15:39:47 +01:00
|
|
|
<xref linkend="charset-table"/> shows the character sets available
|
2006-07-28 17:33:17 +02:00
|
|
|
for use in <productname>PostgreSQL</productname>.
|
2003-03-24 15:32:51 +01:00
|
|
|
</para>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2003-03-24 15:32:51 +01:00
|
|
|
<table id="charset-table">
|
2006-07-28 18:21:57 +02:00
|
|
|
<title><productname>PostgreSQL</productname> Character Sets</title>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<tgroup cols="7">
|
2020-05-06 21:58:23 +02:00
|
|
|
<colspec colname="col1" colwidth="3*"/>
|
|
|
|
<colspec colname="col2" colwidth="2*"/>
|
|
|
|
<colspec colname="col3" colwidth="2*"/>
|
|
|
|
<colspec colname="col4" colwidth="1.25*"/>
|
|
|
|
<colspec colname="col5" colwidth="1*"/>
|
|
|
|
<colspec colname="col6" colwidth="1*"/>
|
|
|
|
<colspec colname="col7" colwidth="2*"/>
|
2000-09-12 07:37:09 +02:00
|
|
|
<thead>
|
2004-12-27 23:30:10 +01:00
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Description</entry>
|
2005-03-13 04:02:08 +01:00
|
|
|
<entry>Language</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Server?</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>ICU?</entry>
|
2005-03-15 03:30:33 +01:00
|
|
|
<!--
|
|
|
|
The Bytes/Char field is populated by looking at the values returned
|
|
|
|
by pg_wchar_table.mblen function for each encoding.
|
|
|
|
-->
|
2020-05-04 22:16:42 +02:00
|
|
|
<entry>Bytes/&zwsp;Char</entry>
|
2005-03-13 03:20:50 +01:00
|
|
|
<entry>Aliases</entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
2000-09-12 07:37:09 +02:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2005-03-13 02:26:30 +01:00
|
|
|
<row>
|
|
|
|
<entry><literal>BIG5</literal></entry>
|
2005-03-13 05:10:23 +01:00
|
|
|
<entry>Big Five</entry>
|
|
|
|
<entry>Traditional Chinese</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>No</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–2</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>WIN950</literal>, <literal>Windows950</literal></entry>
|
2005-03-13 02:26:30 +01:00
|
|
|
</row>
|
2004-12-27 23:30:10 +01:00
|
|
|
<row>
|
|
|
|
<entry><literal>EUC_CN</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Extended UNIX Code-CN</entry>
|
2005-03-13 05:10:23 +01:00
|
|
|
<entry>Simplified Chinese</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–3</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
2005-03-13 02:30:59 +01:00
|
|
|
<entry><literal>EUC_JP</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Extended UNIX Code-JP</entry>
|
|
|
|
<entry>Japanese</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–3</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
2007-03-25 13:56:04 +02:00
|
|
|
<row>
|
|
|
|
<entry><literal>EUC_JIS_2004</literal></entry>
|
|
|
|
<entry>Extended UNIX Code-JP, JIS X 0213</entry>
|
|
|
|
<entry>Japanese</entry>
|
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–3</entry>
|
2007-03-25 13:56:04 +02:00
|
|
|
<entry></entry>
|
|
|
|
</row>
|
2004-12-27 23:30:10 +01:00
|
|
|
<row>
|
2005-03-13 02:30:59 +01:00
|
|
|
<entry><literal>EUC_KR</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Extended UNIX Code-KR</entry>
|
|
|
|
<entry>Korean</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–3</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>EUC_TW</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Extended UNIX Code-TW</entry>
|
2005-03-13 05:10:23 +01:00
|
|
|
<entry>Traditional Chinese, Taiwanese</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–3</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
2005-03-13 02:30:59 +01:00
|
|
|
<row>
|
|
|
|
<entry><literal>GB18030</literal></entry>
|
2005-03-13 05:10:23 +01:00
|
|
|
<entry>National Standard</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Chinese</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>No</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–4</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2005-03-13 02:30:59 +01:00
|
|
|
</row>
|
2005-03-13 02:26:30 +01:00
|
|
|
<row>
|
|
|
|
<entry><literal>GBK</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Extended National Standard</entry>
|
2005-03-13 05:10:23 +01:00
|
|
|
<entry>Simplified Chinese</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>No</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–2</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>WIN936</literal>, <literal>Windows936</literal></entry>
|
2005-03-13 02:26:30 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
2005-03-13 02:30:59 +01:00
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-5, <acronym>ECMA</acronym> 113</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Latin/Cyrillic</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2005-03-13 02:26:30 +01:00
|
|
|
</row>
|
2004-12-27 23:30:10 +01:00
|
|
|
<row>
|
2005-03-13 02:30:59 +01:00
|
|
|
<entry><literal>ISO_8859_6</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-6, <acronym>ECMA</acronym> 114</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Latin/Arabic</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
2005-03-13 02:30:59 +01:00
|
|
|
<entry><literal>ISO_8859_7</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-7, <acronym>ECMA</acronym> 118</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Latin/Greek</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2005-03-13 02:30:59 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>ISO_8859_8</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-8, <acronym>ECMA</acronym> 121</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Latin/Hebrew</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2005-03-13 02:30:59 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>JOHAB</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><acronym>JOHAB</acronym></entry>
|
2005-03-13 05:35:06 +01:00
|
|
|
<entry>Korean (Hangul)</entry>
|
2007-04-15 12:56:30 +02:00
|
|
|
<entry>No</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–3</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2005-03-13 02:30:59 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
2009-02-10 20:29:39 +01:00
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
<entry><acronym>KOI</acronym>8-R</entry>
|
|
|
|
<entry>Cyrillic (Russian)</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>KOI8</literal></entry>
|
2009-02-10 20:29:39 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>KOI8U</literal></entry>
|
|
|
|
<entry><acronym>KOI</acronym>8-U</entry>
|
|
|
|
<entry>Cyrillic (Ukrainian)</entry>
|
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2009-02-10 20:29:39 +01:00
|
|
|
<entry>1</entry>
|
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN1</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-1, <acronym>ECMA</acronym> 94</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Western European</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO88591</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN2</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-2, <acronym>ECMA</acronym> 94</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Central European</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO88592</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN3</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-3, <acronym>ECMA</acronym> 94</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>South European</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO88593</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN4</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-4, <acronym>ECMA</acronym> 94</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>North European</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO88594</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN5</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-9, <acronym>ECMA</acronym> 128</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Turkish</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO88599</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN6</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-10, <acronym>ECMA</acronym> 144</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Nordic</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO885910</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN7</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>ISO 8859-13</entry>
|
|
|
|
<entry>Baltic</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO885913</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN8</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>ISO 8859-14</entry>
|
|
|
|
<entry>Celtic</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO885914</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN9</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>ISO 8859-15</entry>
|
|
|
|
<entry>LATIN1 with Euro and accents</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO885915</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN10</literal></entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry>ISO 8859-16, <acronym>ASRO</acronym> SR 14111</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Romanian</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ISO885916</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
2005-03-13 02:30:59 +01:00
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Mule internal code</entry>
|
2005-11-05 00:14:02 +01:00
|
|
|
<entry>Multilingual Emacs</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–4</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2005-03-13 02:26:30 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>SJIS</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Shift JIS</entry>
|
|
|
|
<entry>Japanese</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>No</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–2</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>Mskanji</literal>, <literal>ShiftJIS</literal>, <literal>WIN932</literal>, <literal>Windows932</literal></entry>
|
2005-03-13 02:26:30 +01:00
|
|
|
</row>
|
2007-03-25 13:56:04 +02:00
|
|
|
<row>
|
|
|
|
<entry><literal>SHIFT_JIS_2004</literal></entry>
|
|
|
|
<entry>Shift JIS, JIS X 0213</entry>
|
|
|
|
<entry>Japanese</entry>
|
|
|
|
<entry>No</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–2</entry>
|
2007-03-25 13:56:04 +02:00
|
|
|
<entry></entry>
|
|
|
|
</row>
|
2005-03-13 02:30:59 +01:00
|
|
|
<row>
|
|
|
|
<entry><literal>SQL_ASCII</literal></entry>
|
2005-10-13 23:43:43 +02:00
|
|
|
<entry>unspecified (see text)</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><emphasis>any</emphasis></entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry></entry>
|
2005-03-13 02:30:59 +01:00
|
|
|
</row>
|
2005-03-13 02:26:30 +01:00
|
|
|
<row>
|
|
|
|
<entry><literal>UHC</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Unified Hangul Code</entry>
|
|
|
|
<entry>Korean</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>No</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–2</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>WIN949</literal>, <literal>Windows949</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
2005-03-13 02:30:59 +01:00
|
|
|
<row>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
2005-03-13 04:44:51 +01:00
|
|
|
<entry>Unicode, 8-bit</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><emphasis>all</emphasis></entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2019-10-25 20:23:44 +02:00
|
|
|
<entry>1–4</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>Unicode</literal></entry>
|
2005-03-13 02:30:59 +01:00
|
|
|
</row>
|
2004-12-27 23:30:10 +01:00
|
|
|
<row>
|
2005-03-07 05:30:55 +01:00
|
|
|
<entry><literal>WIN866</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Windows CP866</entry>
|
|
|
|
<entry>Cyrillic</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ALT</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN874</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Windows CP874</entry>
|
|
|
|
<entry>Thai</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>No</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1250</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Windows CP1250</entry>
|
|
|
|
<entry>Central European</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
2005-03-07 05:30:55 +01:00
|
|
|
<entry><literal>WIN1251</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Windows CP1251</entry>
|
2005-03-15 03:30:33 +01:00
|
|
|
<entry>Cyrillic</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 19:31:25 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>WIN</literal></entry>
|
2005-03-14 19:31:25 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1252</literal></entry>
|
|
|
|
<entry>Windows CP1252</entry>
|
2005-03-15 03:30:33 +01:00
|
|
|
<entry>Western European</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2005-03-15 03:30:33 +01:00
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
2006-07-28 17:33:17 +02:00
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1253</literal></entry>
|
|
|
|
<entry>Windows CP1253</entry>
|
|
|
|
<entry>Greek</entry>
|
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>1</entry>
|
|
|
|
<entry></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1254</literal></entry>
|
|
|
|
<entry>Windows CP1254</entry>
|
|
|
|
<entry>Turkish</entry>
|
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>1</entry>
|
|
|
|
<entry></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1255</literal></entry>
|
|
|
|
<entry>Windows CP1255</entry>
|
|
|
|
<entry>Hebrew</entry>
|
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>1</entry>
|
2006-02-18 17:15:23 +01:00
|
|
|
<entry></entry>
|
|
|
|
</row>
|
2004-12-27 23:30:10 +01:00
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1256</literal></entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Windows CP1256</entry>
|
|
|
|
<entry>Arabic</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>1</entry>
|
|
|
|
<entry></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1257</literal></entry>
|
|
|
|
<entry>Windows CP1257</entry>
|
|
|
|
<entry>Baltic</entry>
|
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2005-03-13 03:33:03 +01:00
|
|
|
<entry></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
2005-03-07 05:30:55 +01:00
|
|
|
<entry><literal>WIN1258</literal></entry>
|
2005-03-13 05:35:06 +01:00
|
|
|
<entry>Windows CP1258</entry>
|
2005-03-13 03:54:34 +01:00
|
|
|
<entry>Vietnamese</entry>
|
2006-07-28 17:33:17 +02:00
|
|
|
<entry>Yes</entry>
|
Further hacking on ICU collation creation and usage.
pg_import_system_collations() refused to create any ICU collations if
the current database's encoding didn't support ICU. This is wrongheaded:
initdb must initialize pg_collation in an encoding-independent way
since it might be used in other databases with different encodings.
The reason for the restriction seems to be that get_icu_locale_comment()
used icu_from_uchar() to convert the UChar-format display name, and that
unsurprisingly doesn't know what to do in unsupported encodings.
But by the same token that the initial catalog contents must be
encoding-independent, we can't allow non-ASCII characters in the comment
strings. So we don't really need icu_from_uchar() here: just check for
Unicode codes outside the ASCII range, and if there are none, the format
conversion is trivial. If there are some, we can simply not install the
comment. (In my testing, this affects only Norwegian Bokmål, which has
given us trouble before.)
For paranoia's sake, also check for non-ASCII characters in ICU locale
names, and skip such locales, as we do for libc locales. I don't
currently have a reason to believe that this will ever reject anything,
but then again the libc maintainers should have known better too.
With just the import changes, ICU collations can be found in pg_collation
in databases with unsupported encodings. This resulted in more or less
clean failures at runtime, but that's not how things act for unsupported
encodings with libc collations. Make it work the same as our traditional
behavior for libc collations by having collation lookup take into account
whether is_encoding_supported_by_icu().
Adjust documentation to match. Also, expand Table 23.1 to show which
encodings are supported by ICU.
catversion bump because of likely change in pg_collation/pg_description
initial contents in ICU-enabled builds.
Discussion: https://postgr.es/m/20c74bc3-d6ca-243d-1bbc-12f17fa4fe9a@gmail.com
2017-06-24 19:54:15 +02:00
|
|
|
<entry>Yes</entry>
|
2005-03-14 03:14:42 +01:00
|
|
|
<entry>1</entry>
|
2017-10-09 03:44:17 +02:00
|
|
|
<entry><literal>ABC</literal>, <literal>TCVN</literal>, <literal>TCVN5712</literal>, <literal>VSCII</literal></entry>
|
2004-12-27 23:30:10 +01:00
|
|
|
</row>
|
2000-09-12 07:37:09 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
Not all client <acronym>API</acronym>s support all the listed character sets. For example, the
|
|
|
|
<productname>PostgreSQL</productname>
|
|
|
|
JDBC driver does not support <literal>MULE_INTERNAL</literal>, <literal>LATIN6</literal>,
|
|
|
|
<literal>LATIN8</literal>, and <literal>LATIN10</literal>.
|
2001-11-28 21:49:10 +01:00
|
|
|
</para>
|
2005-10-13 23:43:43 +02:00
|
|
|
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
The <literal>SQL_ASCII</literal> setting behaves considerably differently
|
2005-10-13 23:43:43 +02:00
|
|
|
from the other settings. When the server character set is
|
2019-10-25 20:23:44 +02:00
|
|
|
<literal>SQL_ASCII</literal>, the server interprets byte values 0–127
|
|
|
|
according to the ASCII standard, while byte values 128–255 are taken
|
2005-10-13 23:43:43 +02:00
|
|
|
as uninterpreted characters. No encoding conversion will be done when
|
2017-10-09 03:44:17 +02:00
|
|
|
the setting is <literal>SQL_ASCII</literal>. Thus, this setting is not so
|
2005-10-13 23:43:43 +02:00
|
|
|
much a declaration that a specific encoding is in use, as a declaration
|
|
|
|
of ignorance about the encoding. In most cases, if you are
|
|
|
|
working with any non-ASCII data, it is unwise to use the
|
2017-10-09 03:44:17 +02:00
|
|
|
<literal>SQL_ASCII</literal> setting because
|
2005-10-13 23:43:43 +02:00
|
|
|
<productname>PostgreSQL</productname> will be unable to help you by
|
|
|
|
converting or validating non-ASCII characters.
|
|
|
|
</para>
|
2002-07-24 07:51:56 +02:00
|
|
|
</sect2>
|
2009-03-26 21:55:49 +01:00
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect2 id="multibyte-setting">
|
2003-03-24 15:32:51 +01:00
|
|
|
<title>Setting the Character Set</title>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
<command>initdb</command> defines the default character set (encoding)
|
2003-03-24 15:32:51 +01:00
|
|
|
for a <productname>PostgreSQL</productname> cluster. For example,
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<screen>
|
2003-03-13 02:30:29 +01:00
|
|
|
initdb -E EUC_JP
|
2001-11-28 21:49:10 +01:00
|
|
|
</screen>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2010-02-03 18:25:06 +01:00
|
|
|
sets the default character set to
|
2003-03-24 15:32:51 +01:00
|
|
|
<literal>EUC_JP</literal> (Extended Unix Code for Japanese). You
|
|
|
|
can use <option>--encoding</option> instead of
|
2010-02-03 18:25:06 +01:00
|
|
|
<option>-E</option> if you prefer longer option strings.
|
2017-10-09 03:44:17 +02:00
|
|
|
If no <option>-E</option> or <option>--encoding</option> option is
|
|
|
|
given, <command>initdb</command> attempts to determine the appropriate
|
2005-04-16 18:50:01 +02:00
|
|
|
encoding to use based on the specified or default locale.
|
2000-09-12 07:37:09 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2008-09-23 11:20:39 +02:00
|
|
|
You can specify a non-default encoding at database creation time,
|
|
|
|
provided that the encoding is compatible with the selected locale:
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<screen>
|
2008-09-23 11:20:39 +02:00
|
|
|
createdb -E EUC_KR -T template0 --lc-collate=ko_KR.euckr --lc-ctype=ko_KR.euckr korean
|
2001-11-28 21:49:10 +01:00
|
|
|
</screen>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2003-03-24 15:32:51 +01:00
|
|
|
This will create a database named <literal>korean</literal> that
|
2008-09-23 11:20:39 +02:00
|
|
|
uses the character set <literal>EUC_KR</literal>, and locale <literal>ko_KR</literal>.
|
|
|
|
Another way to accomplish this is to use this SQL command:
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<programlisting>
|
2009-04-06 10:42:53 +02:00
|
|
|
CREATE DATABASE korean WITH ENCODING 'EUC_KR' LC_COLLATE='ko_KR.euckr' LC_CTYPE='ko_KR.euckr' TEMPLATE=template0;
|
2001-11-28 21:49:10 +01:00
|
|
|
</programlisting>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2017-10-09 03:44:17 +02:00
|
|
|
Notice that the above commands specify copying the <literal>template0</literal>
|
2009-05-06 18:15:21 +02:00
|
|
|
database. When copying any other database, the encoding and locale
|
|
|
|
settings cannot be changed from those of the source database, because
|
|
|
|
that might result in corrupt data. For more information see
|
2017-11-23 15:39:47 +01:00
|
|
|
<xref linkend="manage-ag-templatedbs"/>.
|
2009-05-06 18:15:21 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2003-03-24 15:32:51 +01:00
|
|
|
The encoding for a database is stored in the system catalog
|
2007-09-29 00:25:49 +02:00
|
|
|
<literal>pg_database</literal>. You can see it by using the
|
2010-02-03 18:25:06 +01:00
|
|
|
<command>psql</command> <option>-l</option> option or the
|
|
|
|
<command>\l</command> command.
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<screen>
|
|
|
|
$ <userinput>psql -l</userinput>
|
2008-09-23 11:20:39 +02:00
|
|
|
List of databases
|
2022-04-20 17:04:28 +02:00
|
|
|
Name | Owner | Encoding | Collation | Ctype | Access Privileges
|
2008-09-23 11:20:39 +02:00
|
|
|
-----------+----------+-----------+-------------+-------------+-------------------------------------
|
2022-04-20 17:04:28 +02:00
|
|
|
clocaledb | hlinnaka | SQL_ASCII | C | C |
|
|
|
|
englishdb | hlinnaka | UTF8 | en_GB.UTF8 | en_GB.UTF8 |
|
|
|
|
japanese | hlinnaka | UTF8 | ja_JP.UTF8 | ja_JP.UTF8 |
|
|
|
|
korean | hlinnaka | EUC_KR | ko_KR.euckr | ko_KR.euckr |
|
|
|
|
postgres | hlinnaka | UTF8 | fi_FI.UTF8 | fi_FI.UTF8 |
|
2008-09-23 11:20:39 +02:00
|
|
|
template0 | hlinnaka | UTF8 | fi_FI.UTF8 | fi_FI.UTF8 | {=c/hlinnaka,hlinnaka=CTc/hlinnaka}
|
|
|
|
template1 | hlinnaka | UTF8 | fi_FI.UTF8 | fi_FI.UTF8 | {=c/hlinnaka,hlinnaka=CTc/hlinnaka}
|
|
|
|
(7 rows)
|
2001-11-28 21:49:10 +01:00
|
|
|
</screen>
|
2000-09-12 07:37:09 +02:00
|
|
|
</para>
|
2004-12-27 23:30:10 +01:00
|
|
|
|
|
|
|
<important>
|
|
|
|
<para>
|
2007-09-29 00:25:49 +02:00
|
|
|
On most modern operating systems, <productname>PostgreSQL</productname>
|
2017-10-09 03:44:17 +02:00
|
|
|
can determine which character set is implied by the <envar>LC_CTYPE</envar>
|
2009-05-06 18:15:21 +02:00
|
|
|
setting, and it will enforce that only the matching database encoding is
|
2007-09-29 00:25:49 +02:00
|
|
|
used. On older systems it is your responsibility to ensure that you use
|
|
|
|
the encoding expected by the locale you have selected. A mistake in
|
2010-02-03 18:25:06 +01:00
|
|
|
this area is likely to lead to strange behavior of locale-dependent
|
2007-09-29 00:25:49 +02:00
|
|
|
operations such as sorting.
|
2004-12-27 23:30:10 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2007-09-29 00:25:49 +02:00
|
|
|
<productname>PostgreSQL</productname> will allow superusers to create
|
2017-10-09 03:44:17 +02:00
|
|
|
databases with <literal>SQL_ASCII</literal> encoding even when
|
|
|
|
<envar>LC_CTYPE</envar> is not <literal>C</literal> or <literal>POSIX</literal>. As noted
|
|
|
|
above, <literal>SQL_ASCII</literal> does not enforce that the data stored in
|
2007-09-29 00:25:49 +02:00
|
|
|
the database has any particular encoding, and so this choice poses risks
|
|
|
|
of locale-dependent misbehavior. Using this combination of settings is
|
|
|
|
deprecated and may someday be forbidden altogether.
|
2004-12-27 23:30:10 +01:00
|
|
|
</para>
|
|
|
|
</important>
|
2000-09-12 07:37:09 +02:00
|
|
|
</sect2>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect2 id="multibyte-automatic-conversion">
|
2003-03-24 15:32:51 +01:00
|
|
|
<title>Automatic Character Set Conversion Between Server and Client</title>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
|
|
|
<para>
|
Doc: rearrange the documentation of binary-string functions.
Rather than intermixing the discussion of text-string and binary-string
functions, make a clean break, moving all discussion of binary-string
operations into section 9.5. This involves some duplication of
function descriptions between 9.4 and 9.5, but it seems cleaner on the
whole since the individual descriptions are clearer (and on the other
side of the coin, it gets rid of some duplicated descriptions, too).
Move the convert*/encode/decode functions to a separate table, because
they don't quite seem to fit under the heading of "binary string
functions".
Also provide full documentation of the textual formats supported by
encode() and decode() (which was the original goal of this patch
series, many moons ago).
Also move the table of built-in encoding conversions out of section 9.4,
where it no longer had any relevance whatsoever, and put it into section
23.3 about character sets. I chose to put both that and table 23.2
(multibyte-translation-table) into a new <sect2> so as not to break up
the flow of discussion in 23.3.3.
Also do a bunch of minor copy-editing on the function descriptions
in 9.4 and 9.5.
Karl Pinc, reviewed by Fabien Coelho, further hacking by me
Discussion: https://postgr.es/m/20190304163347.7bca4897@slate.meme.com
2020-01-18 23:51:03 +01:00
|
|
|
<productname>PostgreSQL</productname> supports automatic character
|
|
|
|
set conversion between server and client for many combinations of
|
|
|
|
character sets (<xref linkend="multibyte-conversions-supported"/>
|
|
|
|
shows which ones).
|
2001-11-28 21:49:10 +01:00
|
|
|
</para>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
|
|
|
<para>
|
2005-10-13 23:43:43 +02:00
|
|
|
To enable automatic character set conversion, you have to
|
2003-03-24 15:32:51 +01:00
|
|
|
tell <productname>PostgreSQL</productname> the character set
|
|
|
|
(encoding) you would like to use in the client. There are several
|
|
|
|
ways to accomplish this:
|
2000-09-12 07:37:09 +02:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-12-27 23:30:10 +01:00
|
|
|
Using the <command>\encoding</command> command in
|
|
|
|
<application>psql</application>.
|
|
|
|
<command>\encoding</command> allows you to change client
|
|
|
|
encoding on the fly. For
|
|
|
|
example, to change the encoding to <literal>SJIS</literal>, type:
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<programlisting>
|
2000-09-12 07:37:09 +02:00
|
|
|
\encoding SJIS
|
2001-11-28 21:49:10 +01:00
|
|
|
</programlisting>
|
2000-09-12 07:37:09 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2017-11-23 15:39:47 +01:00
|
|
|
<application>libpq</application> (<xref linkend="libpq-control"/>) has functions to control the client encoding.
|
2000-09-12 07:37:09 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-12-27 23:30:10 +01:00
|
|
|
Using <command>SET client_encoding TO</command>.
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2004-12-27 23:30:10 +01:00
|
|
|
Setting the client encoding can be done with this SQL command:
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<programlisting>
|
2017-10-09 03:44:17 +02:00
|
|
|
SET CLIENT_ENCODING TO '<replaceable>value</replaceable>';
|
2001-11-28 21:49:10 +01:00
|
|
|
</programlisting>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2006-07-28 17:33:17 +02:00
|
|
|
Also you can use the standard SQL syntax <literal>SET NAMES</literal>
|
|
|
|
for this purpose:
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<programlisting>
|
2017-10-09 03:44:17 +02:00
|
|
|
SET NAMES '<replaceable>value</replaceable>';
|
2001-11-28 21:49:10 +01:00
|
|
|
</programlisting>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2004-12-27 23:30:10 +01:00
|
|
|
To query the current client encoding:
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<programlisting>
|
2003-09-11 20:30:39 +02:00
|
|
|
SHOW client_encoding;
|
2001-11-28 21:49:10 +01:00
|
|
|
</programlisting>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2004-12-27 23:30:10 +01:00
|
|
|
To return to the default encoding:
|
2000-09-12 07:37:09 +02:00
|
|
|
|
2001-11-28 21:49:10 +01:00
|
|
|
<programlisting>
|
2003-09-11 20:30:39 +02:00
|
|
|
RESET client_encoding;
|
2001-11-28 21:49:10 +01:00
|
|
|
</programlisting>
|
2000-09-12 07:37:09 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
2001-01-19 05:47:50 +01:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-12-27 23:30:10 +01:00
|
|
|
Using <envar>PGCLIENTENCODING</envar>. If the environment variable
|
2004-03-09 17:57:47 +01:00
|
|
|
<envar>PGCLIENTENCODING</envar> is defined in the client's
|
|
|
|
environment, that client encoding is automatically selected
|
|
|
|
when a connection to the server is made. (This can
|
|
|
|
subsequently be overridden using any of the other methods
|
|
|
|
mentioned above.)
|
2001-01-19 05:47:50 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
2002-07-24 07:51:56 +02:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-03-09 17:57:47 +01:00
|
|
|
Using the configuration variable <xref
|
2017-11-23 15:39:47 +01:00
|
|
|
linkend="guc-client-encoding"/>. If the
|
2017-10-09 03:44:17 +02:00
|
|
|
<varname>client_encoding</varname> variable is set, that client
|
2004-03-09 17:57:47 +01:00
|
|
|
encoding is automatically selected when a connection to the
|
|
|
|
server is made. (This can subsequently be overridden using any
|
|
|
|
of the other methods mentioned above.)
|
2002-07-24 07:51:56 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
2000-09-12 07:37:09 +02:00
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2004-11-15 07:32:15 +01:00
|
|
|
If the conversion of a particular character is not possible
|
|
|
|
— suppose you chose <literal>EUC_JP</literal> for the
|
2010-02-03 18:25:06 +01:00
|
|
|
server and <literal>LATIN1</literal> for the client, and some
|
|
|
|
Japanese characters are returned that do not have a representation in
|
|
|
|
<literal>LATIN1</literal> — an error is reported.
|
2000-09-12 07:37:09 +02:00
|
|
|
</para>
|
2005-10-13 23:43:43 +02:00
|
|
|
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
If the client character set is defined as <literal>SQL_ASCII</literal>,
|
2005-10-13 23:43:43 +02:00
|
|
|
encoding conversion is disabled, regardless of the server's character
|
2019-07-05 20:17:27 +02:00
|
|
|
set. (However, if the server's character set is
|
|
|
|
not <literal>SQL_ASCII</literal>, the server will still check that
|
|
|
|
incoming data is valid for that encoding; so the net effect is as
|
|
|
|
though the client character set were the same as the server's.)
|
|
|
|
Just as for the server, use of <literal>SQL_ASCII</literal> is unwise
|
2005-10-13 23:43:43 +02:00
|
|
|
unless you are working with all-ASCII data.
|
|
|
|
</para>
|
2000-09-12 07:37:09 +02:00
|
|
|
</sect2>
|
|
|
|
|
Doc: rearrange the documentation of binary-string functions.
Rather than intermixing the discussion of text-string and binary-string
functions, make a clean break, moving all discussion of binary-string
operations into section 9.5. This involves some duplication of
function descriptions between 9.4 and 9.5, but it seems cleaner on the
whole since the individual descriptions are clearer (and on the other
side of the coin, it gets rid of some duplicated descriptions, too).
Move the convert*/encode/decode functions to a separate table, because
they don't quite seem to fit under the heading of "binary string
functions".
Also provide full documentation of the textual formats supported by
encode() and decode() (which was the original goal of this patch
series, many moons ago).
Also move the table of built-in encoding conversions out of section 9.4,
where it no longer had any relevance whatsoever, and put it into section
23.3 about character sets. I chose to put both that and table 23.2
(multibyte-translation-table) into a new <sect2> so as not to break up
the flow of discussion in 23.3.3.
Also do a bunch of minor copy-editing on the function descriptions
in 9.4 and 9.5.
Karl Pinc, reviewed by Fabien Coelho, further hacking by me
Discussion: https://postgr.es/m/20190304163347.7bca4897@slate.meme.com
2020-01-18 23:51:03 +01:00
|
|
|
<sect2 id="multibyte-conversions-supported">
|
|
|
|
<title>Available Character Set Conversions</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<productname>PostgreSQL</productname> allows conversion between any
|
|
|
|
two character sets for which a conversion function is listed in the
|
|
|
|
<link linkend="catalog-pg-conversion"><structname>pg_conversion</structname></link>
|
|
|
|
system catalog. <productname>PostgreSQL</productname> comes with
|
|
|
|
some predefined conversions, as summarized in
|
|
|
|
<xref linkend="multibyte-translation-table"/> and shown in more
|
|
|
|
detail in <xref linkend="builtin-conversions-table"/>. You can
|
|
|
|
create a new conversion using the SQL command
|
|
|
|
<xref linkend="sql-createconversion"/>. (To be used for automatic
|
|
|
|
client/server conversions, a conversion must be marked
|
|
|
|
as <quote>default</quote> for its character set pair.)
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table id="multibyte-translation-table">
|
|
|
|
<title>Built-in Client/Server Character Set Conversions</title>
|
|
|
|
<tgroup cols="2">
|
2020-05-06 21:58:23 +02:00
|
|
|
<colspec colname="col1" colwidth="1*"/>
|
|
|
|
<colspec colname="col2" colwidth="3*"/>
|
Doc: rearrange the documentation of binary-string functions.
Rather than intermixing the discussion of text-string and binary-string
functions, make a clean break, moving all discussion of binary-string
operations into section 9.5. This involves some duplication of
function descriptions between 9.4 and 9.5, but it seems cleaner on the
whole since the individual descriptions are clearer (and on the other
side of the coin, it gets rid of some duplicated descriptions, too).
Move the convert*/encode/decode functions to a separate table, because
they don't quite seem to fit under the heading of "binary string
functions".
Also provide full documentation of the textual formats supported by
encode() and decode() (which was the original goal of this patch
series, many moons ago).
Also move the table of built-in encoding conversions out of section 9.4,
where it no longer had any relevance whatsoever, and put it into section
23.3 about character sets. I chose to put both that and table 23.2
(multibyte-translation-table) into a new <sect2> so as not to break up
the flow of discussion in 23.3.3.
Also do a bunch of minor copy-editing on the function descriptions
in 9.4 and 9.5.
Karl Pinc, reviewed by Fabien Coelho, further hacking by me
Discussion: https://postgr.es/m/20190304163347.7bca4897@slate.meme.com
2020-01-18 23:51:03 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Server Character Set</entry>
|
|
|
|
<entry>Available Client Character Sets</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><literal>BIG5</literal></entry>
|
|
|
|
<entry><emphasis>not supported as a server encoding</emphasis>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>EUC_CN</literal></entry>
|
|
|
|
<entry><emphasis>EUC_CN</emphasis>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>EUC_JP</literal></entry>
|
|
|
|
<entry><emphasis>EUC_JP</emphasis>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>SJIS</literal>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>EUC_JIS_2004</literal></entry>
|
|
|
|
<entry><emphasis>EUC_JIS_2004</emphasis>,
|
|
|
|
<literal>SHIFT_JIS_2004</literal>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>EUC_KR</literal></entry>
|
|
|
|
<entry><emphasis>EUC_KR</emphasis>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>EUC_TW</literal></entry>
|
|
|
|
<entry><emphasis>EUC_TW</emphasis>,
|
|
|
|
<literal>BIG5</literal>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>GB18030</literal></entry>
|
|
|
|
<entry><emphasis>not supported as a server encoding</emphasis>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>GBK</literal></entry>
|
|
|
|
<entry><emphasis>not supported as a server encoding</emphasis>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
<entry><emphasis>ISO_8859_5</emphasis>,
|
|
|
|
<literal>KOI8R</literal>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>,
|
|
|
|
<literal>WIN866</literal>,
|
|
|
|
<literal>WIN1251</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>ISO_8859_6</literal></entry>
|
|
|
|
<entry><emphasis>ISO_8859_6</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>ISO_8859_7</literal></entry>
|
|
|
|
<entry><emphasis>ISO_8859_7</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>ISO_8859_8</literal></entry>
|
|
|
|
<entry><emphasis>ISO_8859_8</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>JOHAB</literal></entry>
|
|
|
|
<entry><emphasis>not supported as a server encoding</emphasis>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
<entry><emphasis>KOI8R</emphasis>,
|
|
|
|
<literal>ISO_8859_5</literal>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>,
|
|
|
|
<literal>WIN866</literal>,
|
|
|
|
<literal>WIN1251</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>KOI8U</literal></entry>
|
|
|
|
<entry><emphasis>KOI8U</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN1</literal></entry>
|
|
|
|
<entry><emphasis>LATIN1</emphasis>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN2</literal></entry>
|
|
|
|
<entry><emphasis>LATIN2</emphasis>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>,
|
|
|
|
<literal>WIN1250</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN3</literal></entry>
|
|
|
|
<entry><emphasis>LATIN3</emphasis>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN4</literal></entry>
|
|
|
|
<entry><emphasis>LATIN4</emphasis>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN5</literal></entry>
|
|
|
|
<entry><emphasis>LATIN5</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN6</literal></entry>
|
|
|
|
<entry><emphasis>LATIN6</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN7</literal></entry>
|
|
|
|
<entry><emphasis>LATIN7</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN8</literal></entry>
|
|
|
|
<entry><emphasis>LATIN8</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN9</literal></entry>
|
|
|
|
<entry><emphasis>LATIN9</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>LATIN10</literal></entry>
|
|
|
|
<entry><emphasis>LATIN10</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><emphasis>MULE_INTERNAL</emphasis>,
|
|
|
|
<literal>BIG5</literal>,
|
|
|
|
<literal>EUC_CN</literal>,
|
|
|
|
<literal>EUC_JP</literal>,
|
|
|
|
<literal>EUC_KR</literal>,
|
|
|
|
<literal>EUC_TW</literal>,
|
|
|
|
<literal>ISO_8859_5</literal>,
|
|
|
|
<literal>KOI8R</literal>,
|
|
|
|
<literal>LATIN1</literal> to <literal>LATIN4</literal>,
|
|
|
|
<literal>SJIS</literal>,
|
|
|
|
<literal>WIN866</literal>,
|
|
|
|
<literal>WIN1250</literal>,
|
|
|
|
<literal>WIN1251</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>SJIS</literal></entry>
|
|
|
|
<entry><emphasis>not supported as a server encoding</emphasis>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>SHIFT_JIS_2004</literal></entry>
|
|
|
|
<entry><emphasis>not supported as a server encoding</emphasis>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>SQL_ASCII</literal></entry>
|
|
|
|
<entry><emphasis>any (no conversion will be performed)</emphasis>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>UHC</literal></entry>
|
|
|
|
<entry><emphasis>not supported as a server encoding</emphasis>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><emphasis>all supported encodings</emphasis>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
<entry><emphasis>WIN866</emphasis>,
|
|
|
|
<literal>ISO_8859_5</literal>,
|
|
|
|
<literal>KOI8R</literal>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>,
|
|
|
|
<literal>WIN1251</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN874</literal></entry>
|
|
|
|
<entry><emphasis>WIN874</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1250</literal></entry>
|
|
|
|
<entry><emphasis>WIN1250</emphasis>,
|
|
|
|
<literal>LATIN2</literal>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
<entry><emphasis>WIN1251</emphasis>,
|
|
|
|
<literal>ISO_8859_5</literal>,
|
|
|
|
<literal>KOI8R</literal>,
|
|
|
|
<literal>MULE_INTERNAL</literal>,
|
|
|
|
<literal>UTF8</literal>,
|
|
|
|
<literal>WIN866</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1252</literal></entry>
|
|
|
|
<entry><emphasis>WIN1252</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1253</literal></entry>
|
|
|
|
<entry><emphasis>WIN1253</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1254</literal></entry>
|
|
|
|
<entry><emphasis>WIN1254</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1255</literal></entry>
|
|
|
|
<entry><emphasis>WIN1255</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1256</literal></entry>
|
|
|
|
<entry><emphasis>WIN1256</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1257</literal></entry>
|
|
|
|
<entry><emphasis>WIN1257</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>WIN1258</literal></entry>
|
|
|
|
<entry><emphasis>WIN1258</emphasis>,
|
|
|
|
<literal>UTF8</literal>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<table id="builtin-conversions-table">
|
|
|
|
<title>All Built-in Character Set Conversions</title>
|
|
|
|
<tgroup cols="3">
|
2020-05-06 21:58:23 +02:00
|
|
|
<colspec colname="col1" colwidth="2*"/>
|
|
|
|
<colspec colname="col2" colwidth="1*"/>
|
|
|
|
<colspec colname="col3" colwidth="1*"/>
|
Doc: rearrange the documentation of binary-string functions.
Rather than intermixing the discussion of text-string and binary-string
functions, make a clean break, moving all discussion of binary-string
operations into section 9.5. This involves some duplication of
function descriptions between 9.4 and 9.5, but it seems cleaner on the
whole since the individual descriptions are clearer (and on the other
side of the coin, it gets rid of some duplicated descriptions, too).
Move the convert*/encode/decode functions to a separate table, because
they don't quite seem to fit under the heading of "binary string
functions".
Also provide full documentation of the textual formats supported by
encode() and decode() (which was the original goal of this patch
series, many moons ago).
Also move the table of built-in encoding conversions out of section 9.4,
where it no longer had any relevance whatsoever, and put it into section
23.3 about character sets. I chose to put both that and table 23.2
(multibyte-translation-table) into a new <sect2> so as not to break up
the flow of discussion in 23.3.3.
Also do a bunch of minor copy-editing on the function descriptions
in 9.4 and 9.5.
Karl Pinc, reviewed by Fabien Coelho, further hacking by me
Discussion: https://postgr.es/m/20190304163347.7bca4897@slate.meme.com
2020-01-18 23:51:03 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Conversion Name
|
|
|
|
<footnote>
|
|
|
|
<para>
|
|
|
|
The conversion names follow a standard naming scheme: The
|
|
|
|
official name of the source encoding with all
|
|
|
|
non-alphanumeric characters replaced by underscores, followed
|
|
|
|
by <literal>_to_</literal>, followed by the similarly processed
|
|
|
|
destination encoding name. Therefore, these names sometimes
|
|
|
|
deviate from the customary encoding names shown in
|
|
|
|
<xref linkend="charset-table"/>.
|
|
|
|
</para>
|
|
|
|
</footnote>
|
|
|
|
</entry>
|
|
|
|
<entry>Source Encoding</entry>
|
|
|
|
<entry>Destination Encoding</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><literal>big5_to_euc_tw</literal></entry>
|
|
|
|
<entry><literal>BIG5</literal></entry>
|
|
|
|
<entry><literal>EUC_TW</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>big5_to_mic</literal></entry>
|
|
|
|
<entry><literal>BIG5</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>big5_to_utf8</literal></entry>
|
|
|
|
<entry><literal>BIG5</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_cn_to_mic</literal></entry>
|
|
|
|
<entry><literal>EUC_CN</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_cn_to_utf8</literal></entry>
|
|
|
|
<entry><literal>EUC_CN</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_jp_to_mic</literal></entry>
|
|
|
|
<entry><literal>EUC_JP</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_jp_to_sjis</literal></entry>
|
|
|
|
<entry><literal>EUC_JP</literal></entry>
|
|
|
|
<entry><literal>SJIS</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_jp_to_utf8</literal></entry>
|
|
|
|
<entry><literal>EUC_JP</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_kr_to_mic</literal></entry>
|
|
|
|
<entry><literal>EUC_KR</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_kr_to_utf8</literal></entry>
|
|
|
|
<entry><literal>EUC_KR</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_tw_to_big5</literal></entry>
|
|
|
|
<entry><literal>EUC_TW</literal></entry>
|
|
|
|
<entry><literal>BIG5</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_tw_to_mic</literal></entry>
|
|
|
|
<entry><literal>EUC_TW</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_tw_to_utf8</literal></entry>
|
|
|
|
<entry><literal>EUC_TW</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>gb18030_to_utf8</literal></entry>
|
|
|
|
<entry><literal>GB18030</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>gbk_to_utf8</literal></entry>
|
|
|
|
<entry><literal>GBK</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_10_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN6</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_13_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN7</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_14_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN8</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_15_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN9</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_16_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN10</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_1_to_mic</literal></entry>
|
|
|
|
<entry><literal>LATIN1</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_1_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN1</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_2_to_mic</literal></entry>
|
|
|
|
<entry><literal>LATIN2</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_2_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN2</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_2_to_windows_1250</literal></entry>
|
|
|
|
<entry><literal>LATIN2</literal></entry>
|
|
|
|
<entry><literal>WIN1250</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_3_to_mic</literal></entry>
|
|
|
|
<entry><literal>LATIN3</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_3_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN3</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_4_to_mic</literal></entry>
|
|
|
|
<entry><literal>LATIN4</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_4_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN4</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_5_to_koi8_r</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_5_to_mic</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_5_to_utf8</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_5_to_windows_1251</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_5_to_windows_866</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_6_to_utf8</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_6</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_7_to_utf8</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_7</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_8_to_utf8</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_8</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>iso_8859_9_to_utf8</literal></entry>
|
|
|
|
<entry><literal>LATIN5</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>johab_to_utf8</literal></entry>
|
|
|
|
<entry><literal>JOHAB</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>koi8_r_to_iso_8859_5</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>koi8_r_to_mic</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>koi8_r_to_utf8</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>koi8_r_to_windows_1251</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>koi8_r_to_windows_866</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>koi8_u_to_utf8</literal></entry>
|
|
|
|
<entry><literal>KOI8U</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_big5</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>BIG5</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_euc_cn</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>EUC_CN</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_euc_jp</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>EUC_JP</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_euc_kr</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>EUC_KR</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_euc_tw</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>EUC_TW</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_iso_8859_1</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>LATIN1</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_iso_8859_2</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>LATIN2</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_iso_8859_3</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>LATIN3</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_iso_8859_4</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>LATIN4</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_iso_8859_5</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_koi8_r</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_sjis</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>SJIS</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_windows_1250</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>WIN1250</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_windows_1251</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>mic_to_windows_866</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>sjis_to_euc_jp</literal></entry>
|
|
|
|
<entry><literal>SJIS</literal></entry>
|
|
|
|
<entry><literal>EUC_JP</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>sjis_to_mic</literal></entry>
|
|
|
|
<entry><literal>SJIS</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>sjis_to_utf8</literal></entry>
|
|
|
|
<entry><literal>SJIS</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1258_to_utf8</literal></entry>
|
|
|
|
<entry><literal>WIN1258</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>uhc_to_utf8</literal></entry>
|
|
|
|
<entry><literal>UHC</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_big5</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>BIG5</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_euc_cn</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>EUC_CN</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_euc_jp</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>EUC_JP</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_euc_kr</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>EUC_KR</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_euc_tw</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>EUC_TW</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_gb18030</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>GB18030</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_gbk</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>GBK</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_1</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN1</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_10</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN6</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_13</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN7</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_14</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_15</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN9</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_16</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN10</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_2</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN2</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_3</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN3</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_4</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN4</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_5</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_6</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_6</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_7</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_7</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_8</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_iso_8859_9</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>LATIN5</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_johab</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>JOHAB</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_koi8_r</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_koi8_u</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>KOI8U</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_sjis</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>SJIS</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_1258</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN1258</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_uhc</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>UHC</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_1250</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN1250</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_1251</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_1252</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN1252</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_1253</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN1253</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_1254</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN1254</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_1255</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN1255</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_1256</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN1256</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_1257</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN1257</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_866</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_windows_874</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>WIN874</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1250_to_iso_8859_2</literal></entry>
|
|
|
|
<entry><literal>WIN1250</literal></entry>
|
|
|
|
<entry><literal>LATIN2</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1250_to_mic</literal></entry>
|
|
|
|
<entry><literal>WIN1250</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1250_to_utf8</literal></entry>
|
|
|
|
<entry><literal>WIN1250</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1251_to_iso_8859_5</literal></entry>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1251_to_koi8_r</literal></entry>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1251_to_mic</literal></entry>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1251_to_utf8</literal></entry>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1251_to_windows_866</literal></entry>
|
|
|
|
<entry><literal>WIN1251</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1252_to_utf8</literal></entry>
|
|
|
|
<entry><literal>WIN1252</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_1256_to_utf8</literal></entry>
|
|
|
|
<entry><literal>WIN1256</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_866_to_iso_8859_5</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
<entry><literal>ISO_8859_5</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_866_to_koi8_r</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
<entry><literal>KOI8R</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_866_to_mic</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
<entry><literal>MULE_INTERNAL</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_866_to_utf8</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_866_to_windows_1251</literal></entry>
|
|
|
|
<entry><literal>WIN866</literal></entry>
|
|
|
|
<entry><literal>WIN</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>windows_874_to_utf8</literal></entry>
|
|
|
|
<entry><literal>WIN874</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_jis_2004_to_utf8</literal></entry>
|
|
|
|
<entry><literal>EUC_JIS_2004</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_euc_jis_2004</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>EUC_JIS_2004</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>shift_jis_2004_to_utf8</literal></entry>
|
|
|
|
<entry><literal>SHIFT_JIS_2004</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>utf8_to_shift_jis_2004</literal></entry>
|
|
|
|
<entry><literal>UTF8</literal></entry>
|
|
|
|
<entry><literal>SHIFT_JIS_2004</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>euc_jis_2004_to_shift_jis_2004</literal></entry>
|
|
|
|
<entry><literal>EUC_JIS_2004</literal></entry>
|
|
|
|
<entry><literal>SHIFT_JIS_2004</literal></entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>shift_jis_2004_to_euc_jis_2004</literal></entry>
|
|
|
|
<entry><literal>SHIFT_JIS_2004</literal></entry>
|
|
|
|
<entry><literal>EUC_JIS_2004</literal></entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect2>
|
|
|
|
|
2023-01-09 21:08:24 +01:00
|
|
|
<sect2 id="multibyte-further-reading">
|
2003-03-24 15:32:51 +01:00
|
|
|
<title>Further Reading</title>
|
2000-09-12 07:37:09 +02:00
|
|
|
|
|
|
|
<para>
|
2001-01-19 05:47:50 +01:00
|
|
|
These are good sources to start learning about various kinds of encoding
|
2000-09-12 07:37:09 +02:00
|
|
|
systems.
|
|
|
|
|
2005-03-12 07:28:17 +01:00
|
|
|
<variablelist>
|
2001-10-09 20:46:00 +02:00
|
|
|
<varlistentry>
|
2010-03-17 18:12:31 +01:00
|
|
|
<term><citetitle>CJKV Information Processing: Chinese, Japanese, Korean & Vietnamese Computing</citetitle></term>
|
2001-10-09 20:46:00 +02:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-03-17 18:12:31 +01:00
|
|
|
Contains detailed explanations of <literal>EUC_JP</literal>,
|
2001-10-09 20:46:00 +02:00
|
|
|
<literal>EUC_CN</literal>, <literal>EUC_KR</literal>,
|
2010-03-17 18:12:31 +01:00
|
|
|
<literal>EUC_TW</literal>.
|
2001-10-09 20:46:00 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2019-10-13 22:10:38 +02:00
|
|
|
<term><ulink url="https://www.unicode.org/"></ulink></term>
|
2001-10-09 20:46:00 +02:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2009-05-06 18:15:21 +02:00
|
|
|
The web site of the Unicode Consortium.
|
2001-10-09 20:46:00 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2020-12-01 13:36:30 +01:00
|
|
|
<term><ulink url="https://tools.ietf.org/html/rfc3629">RFC 3629</ulink></term>
|
2001-10-09 20:46:00 +02:00
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-02-03 18:25:06 +01:00
|
|
|
<acronym>UTF</acronym>-8 (8-bit UCS/Unicode Transformation
|
|
|
|
Format) is defined here.
|
2001-10-09 20:46:00 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2000-09-12 07:37:09 +02:00
|
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
</sect1>
|
2000-09-30 18:58:20 +02:00
|
|
|
|
|
|
|
</chapter>
|