Information technology — International string ordering and comparison — Method for comparing character strings and description of the common template tailorable ordering

This document defines the following. — A reference comparison method. This method is applicable to two character strings to determine their collating order in a sorted list. The method can be applied to strings containing characters from the full repertoire of ISO/IEC 10646. This method is also applicable to subsets of that repertoire, such as those of the different ISO/IEC 8-bit standard character sets, or any other character set, standardized or not, to produce ordering results valid (after tailoring) for a given set of languages for each script. This method uses collation tables derived either from the Common Template Table defined in this document or from one of its tailorings. This method provides a reference format. The format is described using the Backus-Naur Form (BNF). This format is used to describe the Common Template Table. The format is used normatively within this document. — A Common Template Table. A given tailoring of the Common Template Table is used by the reference comparison method. The Common Template Table describes an order for all characters encoded in the Unicode 13.0 standard,[27] included in ISO/IEC 10646:2020. It allows for a specification of a fully deterministic ordering. This table enables the specification of a string ordering adapted to local ordering rules, without requiring an implementer to have knowledge of all the different scripts already encoded in the Universal Coded Character Set (UCS). NOTE 1 This Common Template Table is to be modified to suit the needs of a local environment. The main worldwide benefit is that, for other scripts, often no modification is required and the order will remain as consistent as possible and predictable from an international point of view. NOTE 2 The character repertoire used in this document is equivalent to that of the Unicode Standard version 13.0[27]. — A reference name. The reference name refers to this particular version of the Common Template Table, for use as a reference when tailoring. In particular, this name implies that the table is linked to a particular stage of development of the ISO/IEC 10646 Universal coded character set. — Requirements for a declaration of the differences (delta) between the collation table and the Common Template Table. This document does not mandate the following. — A specific comparison method; any equivalent method giving the same results is acceptable. — A specific format for describing or tailoring tables in a given implementation. — Specific symbols to be used by implementations, except for the name of the Common Template Table. — Any specific user interface for choosing options. — Any specific internal format for intermediate keys used when comparing, nor for the table used. The use of numeric keys is not mandated either. — A context-dependent ordering. — Any particular preparation of character strings prior to comparison. NOTE 1 It is normally necessary to do preparation of character strings prior to comparison even if it is not prescribed by this document (see Annex C). NOTE 2 Annex D describes problems that gave way to this International Standard with their anticipated solutions.

Technologies de l'information — Classement international et comparaison de chaînes de caractères — Méthode de comparaison de chaînes de caractères et description du modèle commun et adaptable d'ordre de classement

Le présent document définit ce qui suit. — Une méthode de référence pour la comparaison de deux chaînes de caractères ayant pour but de déterminer leur ordre de classement dans une liste triée. La méthode s'applique à des chaînes utilisant le répertoire complet de l'ISO/IEC 10646, des sous-répertoires tels que ceux des divers jeux normalisés ISO/IEC à 8 bits ou tout autre jeu de caractères, normalisé ou non, et permet de produire des résultats de tri valables (après adaptation) pour un ensemble de langues de chaque système d'écriture. Cette méthode de référence utilise des tables de tri dérivées soit de la table-modèle commune de classement définie dans le présent document, soit d'une de ses adaptations. La méthode procure un format de référence de la table-modèle commune. Ce format est décrit en notation BNF (forme de Backus-Naur, Backus-Naur Form). Son emploi est normatif dans le présent document. — Une table-modèle commune de classement utilisée par la méthode de référence. Cette table décrit un ordre de base pour tous les caractères du standard Unicode 13.027 compris dans l'ISO/IEC 10646:2020. Tout cela permet de spécifier un ordre complètement déterministe. Cette table constitue le point de départ permettant de préciser un ordre de classement adapté aux règles de classement locales, sans qu'il soit nécessaire de connaître tous les systèmes d'écriture repris dans le jeu universel de caractères codés (JUC). NOTE 1 Cette table-modèle commune de classement est destinée à être modifiée pour satisfaire aux besoins d'environnements locaux. L'avantage principal de cette pratique, sur le plan mondial, réside dans le fait que, pour d'autres systèmes d'écriture que celui de l'utilisateur, aucune modification n'est nécessaire et cet ordre demeurera aussi cohérent que possible et prévisible dans un contexte international. NOTE 2 Le répertoire de caractères utilisé dans le présent document est équivalent à celui du standard Unicode, version 13.0[27]. — Un nom de référence représentant cette version particulière de la table-modèle commune, à utiliser comme point de départ à toute adaptation. Ce nom implique notamment que la table est liée à un stade de développement particulier du jeu universel de caractères codés (ISO/IEC 10646). — Des exigences pour la déclaration de différences (delta) entre une table de tri et la table-modèle commune. Le présent document ne spécifie pas ce qui suit. — Une méthode particulière de comparaison; toute méthode équivalente conduisant aux mêmes résultats est acceptable. — Un format précis pour décrire ou pour adapter les tables dans une mise en œuvre donnée. — Des symboles précis à utiliser par les mises en œuvre, sauf pour ce qui est du nom de la table-modèle commune de classement. — Une interface utilisateur particulière destinée à choisir les options. — Un format interne particulier pour les clés intermédiaires utilisées dans les comparaisons ou pour la table de tri. L'utilisation de clés numériques n'est pas spécifiée non plus. — Un ordre dépendant du contexte. — Un prétraitement particulier des chaînes de caractères avant comparaison. NOTE 1 Bien que ceci ne soit pas spécifié par le présent document, il s'avère souvent nécessaire de préparer les chaînes de caractères avant leur comparaison (cf. l'Annexe C). NOTE 2 L'Annexe D décrit les problèmes qui ont donné lieu à la présente Norme internationale avec leurs solutions anticipées.

General Information

Status
Published
Publication Date
20-Dec-2020
Current Stage
9092 - International Standard to be revised
Completion Date
23-Jun-2023
Ref Project

Relations

Buy Standard

Standard
ISO/IEC 14651:2020 - Information technology -- International string ordering and comparison -- Method for comparing character strings and description of the common template tailorable ordering
English language
52 pages
sale 15% off
Preview
sale 15% off
Preview
Standard
ISO/IEC 14651:2020 - Technologies de l'information -- Classement international et comparaison de chaînes de caractères -- Méthode de comparaison de chaînes de caractères et description du modèle commun et adaptable d'ordre de classement
French language
54 pages
sale 15% off
Preview
sale 15% off
Preview
Draft
ISO/IEC PRF 14651:Version 13-okt-2020 - Information technology -- International string ordering and comparison -- Method for comparing character strings and description of the common template tailorable ordering
English language
52 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

INTERNATIONAL ISO/IEC
STANDARD 14651
Sixth edition
2020-12
Information technology —
International string ordering and
comparison — Method for comparing
character strings and description
of the common template tailorable
ordering
Technologies de l'information — Classement international et
comparaison de chaînes de caractères — Méthode de comparaison de
chaînes de caractères et description du modèle commun et adaptable
d'ordre de classement
Reference number
ISO/IEC 14651:2020(E)
©
ISO/IEC 2020

---------------------- Page: 1 ----------------------
ISO/IEC 14651:2020(E)

COPYRIGHT PROTECTED DOCUMENT
© ISO/IEC 2020
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting
on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address
below or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii © ISO/IEC 2020 – All rights reserved

---------------------- Page: 2 ----------------------
ISO/IEC 14651:2020(E)

Contents Page
Foreword .iv
Introduction .v
1 Scope . 1
2 Normative references . 2
3 Terms and definitions . 2
4 Symbols and conventions . 3
5 Conformance . 3
6 String comparison . 4
6.1 Preparation of character strings prior to comparison . 4
6.2 Key building and comparison. 5
6.2.1 Preliminary considerations . 5
6.2.2 Reference ordering key formation . . 6
6.2.3 Reference comparison method for ordering character strings . 8
6.2.4 Key ordering definition . 9
6.3 Common Template Table: Formation and interpretation .10
6.3.1 General.10
6.3.2 BNF syntax rules for the Common Template Table in Annex A .10
6.3.3 Well-formedness conditions .12
6.3.4 Interpretation of tailored tables .13
6.3.5 Evaluation of weight tables .15
6.3.6 Conditions for considering specific table equivalences .15
6.3.7 Conditions for results to be considered equivalent .15
6.4 Declaration of a delta .15
6.5 Name of the Common Template Table and name declaration .17
Annex A (normative) Common Template Table .18
Annex B (informative) Example tailoring deltas .20
Annex C (informative) Preparation .29
Annex D (informative) Tutorial on solutions brought by this document to problems of
lexical ordering .45
Annex E (informative) Searching and fuzzy matches .49
Bibliography .51
© ISO/IEC 2020 – All rights reserved iii

---------------------- Page: 3 ----------------------
ISO/IEC 14651:2020(E)

Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that
are members of ISO or IEC participate in the development of International Standards through
technical committees established by the respective organization to deal with particular fields of
technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other
international organizations, governmental and non-governmental, in liaison with ISO and IEC, also
take part in the work.
The procedures used to develop this document and those intended for its further maintenance are
described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for
the different types of document should be noted. This document was drafted in accordance with the
editorial rules of the ISO/IEC Directives, Part 2 (see www .iso .org/ directives).
Attention is drawn to the possibility that some of the elements of this document may be the subject
of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent
rights. Details of any patent rights identified during the development of the document will be in the
Introduction and/or on the ISO list of patent declarations received (see www .iso .org/ patents) or the IEC
list of patent declarations received (see patents.iec.ch).
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and
expressions related to conformity assessment, as well as information about ISO's adherence to the
World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT), see www .iso .org/
iso/ foreword .html.
This document was prepared by Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 2, Coded character sets.
This sixth edition cancels and replaces the fifth edition (ISO/IEC 14651:2019), which has been
technically revised.
The main changes compared to the previous edition are as follows:
— ordering data has been added for the new characters standardized in the sixth edition of
ISO/IEC 10646 (2020);
— the content of 6.2.2 has been revised for more completeness;
— the weights of character U+A9B5 (JAVANESE VOWEL SIGN TOLONG) have been changed, as the
latter is considered a variant of character U+A9B4 (JAVANESE VOWEL SIGN TARUNG). This needed
to be fixed.
Any feedback or questions on this document should be directed to the user’s national standards body. A
complete listing of these bodies can be found at www .iso .org/ members .html.
iv © ISO/IEC 2020 – All rights reserved

---------------------- Page: 4 ----------------------
ISO/IEC 14651:2020(E)

Introduction
This document provides a method, applicable around the world, for ordering text data, and provides
a Common Template Table which, when tailored, can meet a given language’s ordering requirements
while retaining reasonable ordering for other scripts.
The Common Template Table requires some tailoring in different local environments. Conformance to
this document requires that all deviations from the template, called “deltas”, be declared to document
resultant discrepancies.
This document describes a method to order text data independently of context.
ISO/IEC TR 30112 has specifications for ordering that informatively complement the specifications in
this document and indicates where additional information can be sought on ordering keywords defined
in this document.
© ISO/IEC 2020 – All rights reserved v

---------------------- Page: 5 ----------------------
INTERNATIONAL STANDARD ISO/IEC 14651:2020(E)
Information technology — International string ordering
and comparison — Method for comparing character
strings and description of the common template tailorable
ordering
1 Scope
This document defines the following.
— A reference comparison method. This method is applicable to two character strings to determine
their collating order in a sorted list. The method can be applied to strings containing characters from
the full repertoire of ISO/IEC 10646. This method is also applicable to subsets of that repertoire,
such as those of the different ISO/IEC 8-bit standard character sets, or any other character set,
standardized or not, to produce ordering results valid (after tailoring) for a given set of languages
for each script. This method uses collation tables derived either from the Common Template Table
defined in this document or from one of its tailorings. This method provides a reference format. The
format is described using the Backus-Naur Form (BNF). This format is used to describe the Common
Template Table. The format is used normatively within this document.
— A Common Template Table. A given tailoring of the Common Template Table is used by the reference
comparison method. The Common Template Table describes an order for all characters encoded
[27]
in the Unicode 13.0 standard, included in ISO/IEC 10646:2020. It allows for a specification of
a fully deterministic ordering. This table enables the specification of a string ordering adapted to
local ordering rules, without requiring an implementer to have knowledge of all the different scripts
already encoded in the Universal Coded Character Set (UCS).
NOTE 1 This Common Template Table is to be modified to suit the needs of a local environment. The main
worldwide benefit is that, for other scripts, often no modification is required and the order will remain as
consistent as possible and predictable from an international point of view.
NOTE 2 The character repertoire used in this document is equivalent to that of the Unicode Standard
[27]
version 13.0 .
— A reference name. The reference name refers to this particular version of the Common Template
Table, for use as a reference when tailoring. In particular, this name implies that the table is linked
to a particular stage of development of the ISO/IEC 10646 Universal coded character set.
— Requirements for a declaration of the differences (delta) between the collation table and the Common
Template Table.
This document does not mandate the following.
— A specific comparison method; any equivalent method giving the same results is acceptable.
— A specific format for describing or tailoring tables in a given implementation.
— Specific symbols to be used by implementations, except for the name of the Common Template Table.
— Any specific user interface for choosing options.
— Any specific internal format for intermediate keys used when comparing, nor for the table used. The
use of numeric keys is not mandated either.
— A context-dependent ordering.
— Any particular preparation of character strings prior to comparison.
© ISO/IEC 2020 – All rights reserved 1

---------------------- Page: 6 ----------------------
ISO/IEC 14651:2020(E)

NOTE 1 It is normally necessary to do preparation of character strings prior to comparison even if it is not
prescribed by this document (see Annex C).
NOTE 2 Annex D describes problems that gave way to this International Standard with their anticipated
solutions.
2 Normative references
The following documents are referred to in the text in such a way that some or all of their content
constitutes requirements of this document. For dated references, only the edition cited applies. For
undated references, the latest edition of the referenced document (including any amendments) applies.
ISO/IEC 10646:2020, Information technology — Universal Coded Character Set (UCS)
3 Terms and definitions
For the purposes of this document, the following terms and definitions apply.
ISO and IEC maintain terminological databases for use in standardization at the following addresses:
— IEC Electropedia: available at http:// www .electropedia .org/
— ISO Online browsing platform: available at https:// www .iso .org/ obp
3.1
character string
sequence of characters considered as a single object
Note 1 to entry: Note to entry: A character string to be ordered does not normally include the characters that
delimit it, as for example an “end of line” control character in a text file to be sorted.
3.2
collating symbol
symbol (3.12) used to specify weights assigned to a collating element (3.4)
3.3
collation table
weighting table
mapping from collating elements (3.4) to weighting elements (3.14)
3.4
collating element
sequence of one or more characters that are considered a single entity for ordering (3.7)
3.5
delta
list of the differences between a given collation table (3.3) and another one
Note 1 to entry: The given collation table, together with a given delta, forms a new collation table.
Note 2 to entry: Unless otherwise specified in this document, the term “delta” always refers to differences from
the Common Template Table as defined in this document.
3.6
level
collation level
sequence number for a subkey (3.11) in the series of subkeys forming a key
2 © ISO/IEC 2020 – All rights reserved

---------------------- Page: 7 ----------------------
ISO/IEC 14651:2020(E)

3.7
ordering
collation
process by which, given two strings, it is determined whether the first one is less than, equal to, or
greater than the second one
3.8
ordering key
sequence of subkeys (3.11) used to determine an order
3.9
preparation
collation preparation
process in which given character strings (3.1) are mapped to (other) character strings before the
calculation of the ordering key (3.8) for each of the strings
3.10
reference comparison method
method for establishing an order between two ordering keys (3.8)
Note 1 to entry: See Clause 6.
3.11
subkey
sequence of weights computed for a character string (3.1)
3.12
symbol
collating element (3.4)
3.13
weight
collation weight
positive integer value, used in subkeys (3.11), reflecting the relative order of collating elements (3.4)
3.14
weighting element
list of a given number of weights sequentially ordered by level
4 Symbols and conventions
Following ISO/IEC 10646, characters are referenced as UX where X stands for a series of one to eight
hexadecimal digits (where all the letters in the hexadecimal string are in upper case) and refers to the
value of that character in ISO/IEC 10646. This convention is used throughout this document.
In the Common Template Table, arbitrary symbols representing weights are used according to the BNF
notation description in 6.3.1.
5 Conformance
A process is conformant to this document if it produces results identical to those that result from the
application of the specifications given in 6.2 to 6.5.
A declaration of conformity to this document shall be accompanied by a statement, either directly or by
reference, of the following:
— the number of levels that the process supports; this number shall be at least three;
— whether the process supports the forward position processing parameter;
© ISO/IEC 2020 – All rights reserved 3

---------------------- Page: 8 ----------------------
ISO/IEC 14651:2020(E)

— whether the process supports the backward processing parameter and at which level;
— the tailoring delta described in 6.4 and how many levels are defined in the delta;
— if a preparation process is used, the method used shall be declared.
It is the responsibility of implementers to show how their delta declaration is related to the table syntax
described in 6.3, and how the comparison method they use, if different from the one mentioned in
Clause 6, can be considered as giving the same results as those prescribed by the method specified in
Clause 6. The use of a preparation process is optional and its details are not specified in this document.
It is strongly recommended that processes present available tailoring options to users.
6 String comparison
6.1 Preparation of character strings prior to comparison
It can be necessary to transform character strings before the reference comparison method is applied
to them. Although not part of the Scope of this document, preparation can be an important part of the
ordering process. See Annex C for some examples of preparation.
Characters of the input string shall be encoded according to ISO/IEC 10646 (UCS) or a mapping to
ISO/IEC 10646 shall be provided if another encoding scheme is used.
Therefore it can be an important part of the preparation phase to map characters from a non-UCS
encoding scheme to the UCS for input to the comparison method. This task can, amongst other things,
encompass the correct handling of escape sequences in the originating encoding scheme, the mapping
of characters without an allocated UCS codepoint to an application-defined codepoint in the private
zone area and change the sequence of characters in strings that are not stored in logical order. For
example, for visual order Arabic code sets, input strings shall be put into logical order; and for some
bibliographic code sets, strings with combining accents stored before their respective base character
require that the combining accents be put after their base character. The resulting string sequence may
then have to be remapped into its original encoding scheme.
The Common Template Table is designed so that combining sequences and corresponding single
characters (precomposed) will have precisely the same ordering. To avoid inadvertently breaking
this invariant (and in the process breaking Unicode conformance), tailoring should reorder combining
sequences when corresponding precomposed characters are reordered. For example, if Ä is reordered
after Z, then the sequence + should also be reordered. To avoid exposing
encoding differences that can be invisible to the end-user, it is recommended that strings be normalized
[29]
according to Unicode normalization form NFD to achieve this equivalence (see ).
Escape sequences and control characters constitute very sensitive data to interpret, and it is highly
recommended that preparation should filter out or transform these sequences.
NOTE Since the reference method is a logical statement for the mechanism for string comparison, it does not
preclude an implementation from using a non-UCS character encoding only, as long as it produces results as if it
were using the reference comparison method.
4 © ISO/IEC 2020 – All rights reserved

---------------------- Page: 9 ----------------------
ISO/IEC 14651:2020(E)

6.2 Key building and comparison
6.2.1 Preliminary considerations
6.2.1.1 Assumptions
The collation table is a mapping from collating elements to weighting elements. In each weighting
element, four levels are described in the Common Template Table. This number of levels can be extended
or reduced, but cannot be less than 3, in tailoring.
NOTE In the Common Template Table, levels generally have the following characteristics, although this
purpose is not absolute.
Level 1: This level generally corresponds to the set of common letters of the alphabets for that script, if the script
is alphabetic, and to the set of common characters of the script if the script is ideographic or syllabic.
Level 2: This level generally corresponds to diacritical marks affecting each basic character of the script. For
some languages, letters with diacritics are always considered an integral part of the basic letters of the alphabet
and are not considered at this second level, but rather at the first. For example, in Spanish, N TILDE is considered
a basic letter of the Latin script. Therefore, tailoring for Spanish will change the definition of N TILDE from "the
weight of an N in the first level and the weight of a TILDE in the second level" to "the weight of an N TILDE (placed
after N and before O) in the first level, and indication of the absence of a diacritic in the second level". For some
characters, variant letter shapes are also dealt with on level 2. An example of this is ß, the LATIN SMALL LETTER
SHARP S, which is treated as equivalent to ss on level 1, but traditionally distinguished from it on level 2.
Level 3: This level generally corresponds to case distinctions (upper and lower case) or to distinctions based on
variant letter shapes (like the distinction between Hiragana and Katakana).
Level 4: This level generally corresponds to weighting differences that are less significant than those at the other
levels. Often the last level (level 4 in the Common Template Table) is intended to specify additional weighting for
"special" characters, i.e. characters normally not part of the spelling of words of a language (such as dingbats,
punctuation, etc.), sometimes called "ignorable" characters in the context of computerized ordering.
6.2.1.2 Processing properties
A given tailored table has specific scanning and ordering properties. These properties can have been
changed by the tailoring.
A scanning direction (forward or backward) for each level is used to indicate how to process the string.
The scanning direction is a global property of each level defined in the tailored table.
If the last level is greater than three, there is an optional property of this level of comparison called
“position” option: when active, a comparison on the numeric position of each “ignorable” character in
the two strings is effected, before comparing their weights. In other words, for two strings equivalent
at all levels except the last one, the string having an ignorable character in the lowest position comes
before the other one. In case corresponding ignorable characters are at the same position, then their
weights are considered, until a difference is found. Support for this kind of processing is optional and is
not necessary to claim conformance to this document.
NOTE The scanning direction (forward or backward) is not normally related to the natural writing direction
of scripts. The scanning direction applies to the logical sequence of the coded character string.
According to ISO/IEC 10646, for scripts written right to left, such as Arabic, the first characters in
the logical sequence correspond to the rightmost characters in their natural presentation sequence.
Conversely, for the Latin script, written left to right, the first characters in the logical sequence
correspond to the leftmost characters in their natural presentation sequence.
Scanning forward starts with the lowest position in the logical sequence, while scanning backward
starts from the highest position, independently of the presentation sequence. The scanning direction
for ordering purposes is a global property of each level described in the table.
© ISO/IEC 2020 – All rights reserved 5

---------------------- Page: 10 ----------------------
ISO/IEC 14651:2020(E)

In ISO/IEC 10646, the Arabic script is artificially separated into two pseudo-scripts: 1) the logical,
intrinsic Arabic, coded independently of contextual shapes, and 2) the Arabic presentation forms.
Both allow the complete coding of Arabic, but intrinsic Arabic is normally preferred for better
processing, while presentation-form Arabic is preferred by some presentation-oriented applications.
ISO/IEC 10646 does not prescribe that the presentation forms be stored in any specific order, and
in some implementations, the storage order for the latter is the reverse of the storage order used for
intrinsic Arabic. It is therefore advisable that the preparation phase be used to make sure that Arabic
presentation forms and other Arabic characters be fed to the comparison method in logical order.
A tailored sort table can be separated into sections for ease of tailoring. Each section is then assigned
a name consistent with the specification in 6.3.1. One of the tailoring possibilities is to assign a given
order to each section and to change the relative order of an entire section relative to other sections.
6.2.2 Reference ordering key formation
6.2.2.1 General
When two strings are to be compared to determine their relative order, the two strings are first parsed
into a sequence of collating elements taking into account the multi-character “collating-element”
statements declared and used in a tailored table (if the syntax of 6.3.2 is used). For the syntax used for
expressing the Common Template Table, the name of a collating element consisting of a single character,
is formed by the UCS value of the character, expressed as a hexadecimal string, prefixed with “U”.
For multi-character collating elements, the name and association to characters can be found via the
collating elements declarations.
NOTE Collating elements with more characters have preference over shorter ones. As an example, if a
multicharacter collating element is defined for “abc” and another one is defined for “ab” or for “bc”, then if “abc” is
encountered, the collating element for “abc” will apply and not the one for “ab” or “bc”.
Then, a sequence of m intermediary subkeys is formed out of a character string, where m is the number
of levels described in a tailored collation weighting table.
Each ordering key is a sequence of subkeys. Each subkey is a list of numeric weights. A subkey is formed
by successively appending the list of the weights assigned, at the level of the subkey, to each collating
element of the string. The keyword “IGNORE” in the Common Template Table at the place of a sequence
of collating symbols at a level indicates that the sequence of weights at that level for that collating
element is an empty sequence of weights.
6.2.2.2 Weighting elements to be ignored
When forming a sort key, collating elements ignored at the first level or at the two first levels and that
follow a collation element ignored at all levels but the last one, do not keep their weights as defined in
the common template table (or a tailored table); each of these weights shall be zeroed (this means that
“IGNORE” shall be assigned to each non-nil weight).
6.2.2.3 Implicit weights computing
If there is no entry in the tailored table for a character of the input string, then the character’s weights
are undefined. In this case, one shall compute an “implicit” primary weight consisting of a pair of 16-
bit words — call them “aaaa” and “bbbb” — and assume that lines like the following were added to the
weighting table:
"";;;
16 16
NOTE (at the last level) is the largest level 1 weight in the Common Template Table.
6 © ISO/IEC 2020 – All rights reserved

---------------------- Page: 11 ----------------------
ISO/IEC 14651:2020(E)

Distinctions are needed among characters with no entry in the weighting table, and implicit primary
weights are thus computed as defined here:
a) Unified Han ideographs:
For a given Han character at code point cp:
base_weight = 0xFB40 for original URO
base_weight = 0xFB80 for Ex
...

NORME ISO/IEC
INTERNATIONALE 14651
Sixième édition
2020-12
Technologies de l'information —
Classement international et
comparaison de chaînes de caractères
— Méthode de comparaison de
chaînes de caractères et description
du modèle commun et adaptable
d'ordre de classement
Information technology — International string ordering and
comparison — Method for comparing character strings and
description of the common template tailorable ordering
Numéro de référence
ISO/IEC 14651:2020(F)
©
ISO/IEC 2020

---------------------- Page: 1 ----------------------
ISO/IEC 14651:2020(F)

DOCUMENT PROTÉGÉ PAR COPYRIGHT
© ISO/IEC 2020
Tous droits réservés. Sauf prescription différente ou nécessité dans le contexte de sa mise en œuvre, aucune partie de cette
publication ne peut être reproduite ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique,
y compris la photocopie, ou la diffusion sur l’internet ou sur un intranet, sans autorisation écrite préalable. Une autorisation peut
être demandée à l’ISO à l’adresse ci-après ou au comité membre de l’ISO dans le pays du demandeur.
ISO copyright office
Case postale 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Genève
Tél.: +41 22 749 01 11
E-mail: copyright@iso.org
Web: www.iso.org
Publié en Suisse
ii © ISO/IEC 2020 – Tous droits réservés

---------------------- Page: 2 ----------------------
ISO/IEC 14651:2020(F)

Sommaire Page
Avant-propos .iv
Introduction .v
1 Domaine d'application . 1
2 Références normatives . 2
3 Termes et définitions . 2
4 Symboles et conventions . 3
5 Conformité . 3
6 Comparaison de chaînes . 4
6.1 Prétraitement des chaînes de caractères avant comparaison . 4
6.2 Construction des clés et comparaison . 5
6.2.1 Préliminaires . 5
6.2.2 Méthode de référence de construction des clés . 6
6.2.3 Méthode de comparaison de référence pour le tri des chaînes de caractères. 8
6.2.4 Méthode de comparaison de référence pour le tri des chaînes de caractères. 9
6.3 Table-modèle commune: composition et interprétation.10
6.3.1 Généralités .10
6.3.2 Règles de syntaxe BNF pour la table-modèle commune de l’Annexe A . .10
6.3.3 Contraintes de forme . .12
6.3.4 Interprétation des tables adaptées .14
6.3.5 Évaluation des tables de poids .15
6.3.6 Conditions d’équivalence de tables spécifiques .15
6.3.7 Conditions d’équivalence des résultats .16
6.4 Déclaration d’un delta .16
6.5 Nom de la table-modèle commune et déclaration de nom .18
Annexe A (normative) Table-modèle commune .19
Annexe B (informative) Exemples de deltas d’adaptation .21
Annexe C (informative) Prétraitement .31
Annexe D (informative) Annexe didactique sur les solutions apportées par le présent
document aux problèmes de tri lexical .47
Annexe E (informative) Recherches et correspondances floues .51
Bibliographie .53
© ISO/IEC 2020 – Tous droits réservés iii

---------------------- Page: 3 ----------------------
ISO/IEC 14651:2020(F)

Avant-propos
L'ISO (Organisation internationale de normalisation) et l’IEC (Commission électrotechnique
internationale) forment le système spécialisé de la normalisation mondiale. Les organismes
nationaux membres de l'ISO ou de l’IEC participent au développement de Normes internationales
par l'intermédiaire des comités techniques créés par l'organisation concernée afin de s'occuper des
domaines particuliers de l'activité technique. Les comités techniques de l'ISO et de l’IEC collaborent
dans des domaines d'intérêt commun. D'autres organisations internationales, gouvernementales et non
gouvernementales, en liaison avec l'ISO et l’IEC, participent également aux travaux.
Les procédures utilisées pour élaborer le présent document et celles destinées à sa mise à jour sont
décrites dans les Directives ISO/IEC, Partie 1. Il convient, en particulier de prendre note des différents
critères d'approbation requis pour les différents types de documents ISO. Le présent document a été
rédigé conformément aux règles de rédaction données dans les Directives ISO/IEC, Partie 2 (voir www
.iso .org/ directives).
L'attention est attirée sur le fait que certains des éléments du présent document peuvent faire l'objet
de droits de propriété intellectuelle ou de droits analogues. L'ISO et l’IEC ne sauraient être tenues pour
responsables de ne pas avoir identifié de tels droits de propriété et averti de leur existence. Les détails
concernant les références aux droits de propriété intellectuelle ou autres droits analogues identifiés
lors de l'élaboration du document sont indiqués dans l'Introduction et/ou dans la liste des déclarations
de brevets reçues par l'ISO (voir www .iso .org/ brevets) ou dans la liste des déclarations de brevets
reçues par l'IEC (voir patents.iec.ch).
Les appellations commerciales éventuellement mentionnées dans le présent document sont données
pour information, par souci de commodité, à l’intention des utilisateurs et ne sauraient constituer un
engagement.
Pour une explication de la nature volontaire des normes, la signification des termes et expressions
spécifiques de l'ISO liés à l'évaluation de la conformité, ou pour toute information au sujet de l'adhésion
de l'ISO aux principes de l’Organisation mondiale du commerce (OMC) concernant les obstacles
techniques au commerce (OTC), voir: www .iso .org/ iso/ avant -propos.
Le présent document a été élaboré par le comité technique ISO/IEC/JTC 1, Technologies de l'information,
sous-comité SC 2, Jeux de caractères codés.
Cette sixième édition annule et remplace la cinquième édition (ISO/IEC 14651:2019), qui a fait l'objet
d'une révision technique.
Les principales modifications par rapport à l’édition précédente sont les suivantes:
— le présent document ajoute les données de classement des nouveaux caractères normalisés dans la
sixième édition de l’ISO/IEC 10646 (2020) ;
— le contenu de 6.2.2 a été révisé pour le rendre plus complet ;
— les poids du caractère U+A9B5 (DIACRITIQUE VOYELLE JAVANAISE TOLONG) ont été modifiés,
car ce dernier est considéré comme une variante du caractère U+A9B4 (DIACRITIQUE VOYELLE
JAVANAISE TARUNG). Cela se devait d’être corrigé.
Il convient que l’utilisateur adresse tout retour d’information ou toute question concernant le présent
document à l’organisme national de normalisation de son pays. Une liste exhaustive desdits organismes
se trouve à l’adresse www .iso .org/ members .html.
iv © ISO/IEC 2020 – Tous droits réservés

---------------------- Page: 4 ----------------------
ISO/IEC 14651:2020(F)

Introduction
Le présent document fournit une méthode universelle de mise en ordre des données textuelles. Elle
fournit également une table-modèle commune qui, lorsqu'elle est adaptée, peut satisfaire aux exigences
de tri d’une langue donnée, tout en triant de manière raisonnable les autres écritures.
La table-modèle commune est conçue de sorte qu’une adaptation s’avère nécessaire pour chaque
environnement local. C’est pourquoi la conformité au présent document requiert que les modifications
à cette table commune, appelées «deltas», soient déclarées de manière à documenter les différences
dans les résultats.
Le présent document décrit une méthode pour classer l’information textuelle de manière indépendante
du contexte.
L’ISO/IEC TR 30112 contient des dispositions pour le tri complémentaires à celles du présent document;
on y trouve aussi des renseignements complémentaires sur les mots-clés définis dans le présent
document et utilisés pour le tri.
© ISO/IEC 2020 – Tous droits réservés v

---------------------- Page: 5 ----------------------
NORME INTERNATIONALE ISO/IEC 14651:2020(F)
Technologies de l'information — Classement international
et comparaison de chaînes de caractères — Méthode de
comparaison de chaînes de caractères et description du
modèle commun et adaptable d'ordre de classement
1 Domaine d'application
Le présent document définit ce qui suit.
— Une méthode de référence pour la comparaison de deux chaînes de caractères ayant pour but de
déterminer leur ordre de classement dans une liste triée. La méthode s'applique à des chaînes
utilisant le répertoire complet de l’ISO/IEC 10646, des sous-répertoires tels que ceux des divers
jeux normalisés ISO/IEC à 8 bits ou tout autre jeu de caractères, normalisé ou non, et permet de
produire des résultats de tri valables (après adaptation) pour un ensemble de langues de chaque
système d’écriture. Cette méthode de référence utilise des tables de tri dérivées soit de la table-
modèle commune de classement définie dans le présent document, soit d’une de ses adaptations.
La méthode procure un format de référence de la table-modèle commune. Ce format est décrit en
notation BNF (forme de Backus-Naur, Backus-Naur Form). Son emploi est normatif dans le présent
document.
— Une table-modèle commune de classement utilisée par la méthode de référence. Cette table
27
décrit un ordre de base pour tous les caractères du standard Unicode 13.0 compris dans
l’ISO/IEC 10646:2020. Tout cela permet de spécifier un ordre complètement déterministe. Cette
table constitue le point de départ permettant de préciser un ordre de classement adapté aux règles
de classement locales, sans qu’il soit nécessaire de connaître tous les systèmes d’écriture repris
dans le jeu universel de caractères codés (JUC).
NOTE 1 Cette table-modèle commune de classement est destinée à être modifiée pour satisfaire aux
besoins d'environnements locaux. L'avantage principal de cette pratique, sur le plan mondial, réside dans le
fait que, pour d'autres systèmes d’écriture que celui de l’utilisateur, aucune modification n’est nécessaire et
cet ordre demeurera aussi cohérent que possible et prévisible dans un contexte international.
NOTE 2 Le répertoire de caractères utilisé dans le présent document est équivalent à celui du standard
[27]
Unicode, version 13.0 .
— Un nom de référence représentant cette version particulière de la table-modèle commune, à utiliser
comme point de départ à toute adaptation. Ce nom implique notamment que la table est liée à un
stade de développement particulier du jeu universel de caractères codés (ISO/IEC 10646).
— Des exigences pour la déclaration de différences (delta) entre une table de tri et la table-modèle
commune.
Le présent document ne spécifie pas ce qui suit.
— Une méthode particulière de comparaison; toute méthode équivalente conduisant aux mêmes
résultats est acceptable.
— Un format précis pour décrire ou pour adapter les tables dans une mise en œuvre donnée.
— Des symboles précis à utiliser par les mises en œuvre, sauf pour ce qui est du nom de la table-modèle
commune de classement.
— Une interface utilisateur particulière destinée à choisir les options.
© ISO/IEC 2020 – Tous droits réservés 1

---------------------- Page: 6 ----------------------
ISO/IEC 14651:2020(F)

— Un format interne particulier pour les clés intermédiaires utilisées dans les comparaisons ou pour
la table de tri. L’utilisation de clés numériques n’est pas spécifiée non plus.
— Un ordre dépendant du contexte.
— Un prétraitement particulier des chaînes de caractères avant comparaison.
NOTE 1 Bien que ceci ne soit pas spécifié par le présent document, il s’avère souvent nécessaire de préparer
les chaînes de caractères avant leur comparaison (cf. l’Annexe C).
NOTE 2 L'Annexe D décrit les problèmes qui ont donné lieu à la présente Norme internationale avec leurs
solutions anticipées.
2 Références normatives
Les documents suivants sont cités dans le texte de sorte qu’ils constituent, pour tout ou partie de leur
contenu, des exigences du présent document. Pour les références datées, seule l’édition citée s’applique.
Pour les références non datées, la dernière édition du document de référence s'applique (y compris les
éventuels amendements).
ISO/IEC 10646:2020, Technologies de l’information — Jeu universel de caractères codés (JUC)
3 Termes et définitions
Pour les besoins du présent document, les termes et définitions suivants s’appliquent.
L’ISO et l’IEC tiennent à jour des bases de données terminologiques destinées à être utilisées en
normalisation, consultables aux adresses suivantes:
— ISO Online browsing platform: disponible à l’adresse https:// www .iso .org/ obp
— IEC Electropedia: disponible à l’adresse http:// www .electropedia .org/
3.1
chaîne de caractères
suite de caractères considérée comme un objet simple
Note 1 à l'article: Note à l'article: Une chaîne de caractères à trier ne comprend normalement pas les caractères
qui la délimitent, comme par exemple un caractère de commande de fin de ligne dans un fichier texte à trier.
3.2
symbole de tri
symbole (3.12) utilisé pour préciser les poids attribués à un élément de tri (3.4)
3.3
table de tri
table de poids
table reliant les éléments de tri (3.4) aux éléments de poids (3.14)
3.4
élément de tri
suite constituée d’un ou de plusieurs caractères considérés comme une seule entité aux fins du tri (3.7)
3.5
delta
liste des différences que présente une table de tri (3.3) donnée par rapport à une autre
Note 1 à l'article: Une table de tri donnée associée à un delta donné forme une nouvelle table de tri.
Note 2 à l'article: Sauf mention contraire, le terme «delta» désigne toujours les différences par rapport à la table-
modèle commune définie dans le présent document.
2 © ISO/IEC 2020 – Tous droits réservés

---------------------- Page: 7 ----------------------
ISO/IEC 14651:2020(F)

3.6
niveau
niveau de tri
numéro d’une sous-clé (3.11) dans la série de sous-clés formant une clé
3.7
tri
procédé par lequel on détermine si, de deux chaînes, la première est plus petite, égale ou plus grande
que la seconde
3.8
clé de tri
série de sous-clés (3.11) utilisée pour déterminer un ordre
3.9
prétraitement
procédé par lequel des chaînes de caractères (3.1) données sont transformées en d’autres chaînes avant
le calcul de la clé de tri (3.8) de chaque chaîne
3.10
méthode de comparaison de référence
méthode de détermination de l’ordre relatif de deux clés de tri (3.8)
Note 1 à l'article: Voir l'Article 6.
3.11
sous-clé
suite de poids calculée pour une chaîne de caractères (3.1)
3.12
symbole
élément de tri (3.4)
3.13
poids
poids de tri
entier positif, utilisé dans les sous-clés (3.11), pour indiquer l’ordre relatif des éléments de tri (3.4)
3.14
élément de poids
liste d’un certain nombre de poids séquentiellement ordonnés par niveau
4 Symboles et conventions
Selon l’ISO/IEC 10646, les caractères se représentent à l’aide de UX, où X correspond à une série
d’un à huit chiffres hexadécimaux (où toutes les lettres de la série de chiffres hexadécimaux sont en
majuscules) et où X est le numéro du caractère dans l’ISO/IEC 10646. Cette convention est reprise dans
le présent document.
Dans la table-modèle commune, des symboles arbitraires représentent des poids selon la notation BNF
décrite en 6.3.1.
5 Conformité
Un processus est conforme au présent document s’il produit des résultats identiques à ceux qui résultent
de l’application des spécifications décrites en 6.2 à 6.5.
© ISO/IEC 2020 – Tous droits réservés 3

---------------------- Page: 8 ----------------------
ISO/IEC 14651:2020(F)

Toute déclaration de conformité au présent document doit être accompagnée, directement ou par
référence, d’une déclaration de ce qui suit.
— Le nombre de niveaux de tri que le processus peut utiliser; ce nombre doit être égal ou supérieur
à trois.
— Si le paramètre de traitement forward,position est permis.
— Si le paramètre de traitement backward est permis et à quel niveau.
— Le delta d’adaptation décrit en 6.4 et le nombre de niveaux définis dans ce delta.
— Si un processus de prétraitement est utilisé, la méthode utilisée doit être déclarée.
Il incombe au producteur de montrer en quoi sa déclaration de delta est reliée à la syntaxe de la table
décrite en 6.3, et comment la méthode de comparaison utilisée, si elle est différente de celle mentionnée
à l’Article 6, peut être considérée comme produisant les mêmes résultats que ceux spécifiés par la
méthode décrite à l’Article 6. L'usage d'un processus de prétraitement est optionnel et ses détails ne
sont pas précisés dans le présent document.
Il est fortement recommandé que l’application présente à l’utilisateur les options et adaptations
disponibles.
6 Comparaison de chaînes
6.1 Prétraitement des chaînes de caractères avant comparaison
Il peut s’avérer nécessaire de transformer les chaînes de caractères avant de leur appliquer la méthode
de comparaison de référence. Bien que n’étant pas l’objet du présent document, le prétraitement peut
être une partie importante du processus de tri. Voir l’Annexe C pour des exemples de prétraitement.
Les caractères de la chaîne d'entrée doivent être codés conformément à l’ISO/IEC 10646 (JUC) ou une
correspondance à l’ISO/IEC 10646 doit être fournie si une autre forme de codage est utilisée.
Par conséquent, une partie importante de la phase préparatoire consiste à transformer les caractères
d’un codage non-JUC à des caractères du JUC fournis en entrée à la méthode de comparaison. Cette
tâche peut comprendre notamment le traitement correct de séquences d’échappement dans le codage
original, la transformation de caractères sans attribution dans le JUC à des positions de code dans la
zone privée et la transposition de caractères dans le cas de chaînes qui ne seraient pas stockées en
ordre logique. Par exemple, dans le cas de codages arabes en ordre visuel, les caractères doivent être
mis en ordre logique; dans le cas de certains codages à usage bibliographique, les accents combinatoires
stockés avant leur caractère de base doivent être déplacés après le caractère de base. La suite résultante
peut devoir être retransformée dans le codage original.
La table-modèle commune est conçue de sorte que les séquences combinatoires et les caractères simples
(précomposés) correspondants aient exactement le même ordre. Pour éviter de violer par mégarde cet
invariant (et au passage la conformité à Unicode), il convient que l’adaptation change le classement
des séquences combinatoires quand le classement des caractères précomposés correspondants est
changé. Par exemple, si Ä est déplacé après Z, il convient alors de changer aussi le classement de la
séquence combinatoire + < tréma combinatoire >. Pour éviter de révéler des différences de codage
invisibles à l’utilisateur, on recommande de normaliser les chaînes selon la forme FND de l’algorithme
de normalisation Unicode – voir [29] dans la bibliographie.
Les séquences d’échappement et les caractères de commande sont très délicats à interpréter; il est
fortement recommandé de les filtrer ou de les transformer.
NOTE Puisque la méthode de comparaison de référence est une description logique du procédé de
comparaison de chaînes, rien n’empêche une mise en œuvre de cette méthode d’utiliser exclusivement un codage
autre qu’un codage du JUC, pour autant que les résultats obtenus soient les mêmes que si la méthode de référence
était utilisée.
4 © ISO/IEC 2020 – Tous droits réservés

---------------------- Page: 9 ----------------------
ISO/IEC 14651:2020(F)

6.2 Construction des clés et comparaison
6.2.1 Préliminaires
6.2.1.1 Hypothèses
La table de tri est une transformation des éléments de tri en éléments de poids. Pour chaque élément
de poids, la table-modèle commune décrit quatre niveaux. L’adaptation peut augmenter ou réduire ce
nombre de niveaux, mais pas à moins de trois.
NOTE Dans la table-modèle commune, les niveaux ont généralement les significations suivantes, bien que cet
usage ne soit pas absolu:
Niveau 1: ce niveau correspond généralement au jeu de lettres de base pour une écriture
alphabétique, au jeu de caractères courants pour une écriture idéographique ou syllabique.
Niveau 2: ce niveau correspond généralement aux diacritiques pouvant accompagner les caractères
de base de chaque écriture. En certaines langues, les lettres accentuées sont considérées comme des
lettres de base de l’alphabet et ne sont pas affectées par ce niveau, mais seulement par le premier
niveau. En espagnol par exemple, le N TILDE est considéré comme une lettre de base de l’alphabet
latin; par conséquent, une adaptation pour l’espagnol changera la définition de N TILDE de «le poids
d’un N au premier niveau et le poids d’un TILDE au second niveau» à «le poids d’un N TILDE (entre
N et O) au premier niveau et une indication de l’absence de diacritique au second niveau». Pour
certains caractères, on prend également en compte des variantes de forme au second niveau, par
exemple ß (la LETTRE MINUSCULE LATINE S DUR), qui est traitée comme un équivalent de ss au
premier niveau mais s’en distingue traditionnellement au second niveau.
Niveau 3: ce niveau est généralement associé aux distinctions de casse (majuscules-minuscules) ou
aux variantes de formes (comme la distinction entre hiragana et katakana).
Niveau 4: ce niveau est généralement consacré aux distinctions pondérales plus fines que celles des
autres niveaux. Le dernier niveau (le quatrième dans la table-modèle commune) est souvent utilisé
pour donner des poids additionnels à des caractères «spéciaux», c’est-à-dire des caractères qui ne
sont pas normalement utilisés dans l’orthographe des mots d’une langue (ponctuation, vignettes,
etc.), souvent appelés «ignorables» dans le contexte du tri informatique.
6.2.1.2 Propriétés de traitement
Une table de tri adaptée donnée possède des propriétés spécifiques de balayage et de classement. Ces
propriétés peuvent avoir été changées par l’adaptation.
Une direction de balayage (vers l’avant ou vers l’arrière) pour chaque niveau est utilisée pour indiquer
comment traiter la chaîne. La direction de balayage est une propriété globale de chaque niveau défini
dans la table adaptée.
Si le dernier niveau est supérieur à trois, il existe une propriété optionnelle de ce niveau appelée l’option
«position»: lorsqu'elle est active, une comparaison des positions numériques de chaque caractère
«ignorable» dans les deux chaînes est effectuée, avant de comparer leurs poids. En d’autres mots, si deux
chaînes sont équivalentes à tous les niveaux sauf le dernier, la chaîne contenant un caractère ignorable
en position la plus basse est classée avant l’autre. Si les caractères ignorables ont les mêmes positions,
alors leurs poids sont considérés jusqu’à ce qu’une différence soit trouvée. Le traitement correct de
cette propriété optionnelle n’est pas nécessaire à la conformité au présent document.
NOTE La direction de balayage (vers l’avant ou vers l’arrière) n’est normalement pas reliée à la direction
naturelle d’écriture. La direction de balayage s’applique à la suite logique de la chaîne de caractères codés.
Dans le cas d’écritures de droite à gauche comme l’arabe, l’ISO/IEC 10646 spécifie que les premiers
caractères en ordre logique sont ceux apparaissant à droite en ordre de présentation. En écriture latine
au contraire, les premiers caractères en ordre logique apparaissent à gauche en ordre de présentation.
© ISO/IEC 2020 – Tous droits réservés 5

---------------------- Page: 10 ----------------------
ISO/IEC 14651:2020(F)

Le balayage vers l’avant commence au début de la séquence en ordre logique, alors que le balayage vers
l’arrière commence à la fin, sans égard à la direction de présentation. La direction de balayage à des fins
de tri est une propriété globale de chaque niveau décrit dans la table.
Dans l’ISO/IEC 10646, l’écriture arabe est artificiellement séparée en deux pseudo-écritures: 1)
l’écriture arabe logique, intrinsèque, codée indépendamment des formes contextuelles et 2) les formes
de présentations arabes. Les deux permettent le codage complet de l’arabe, mais le codage intrinsèque
est normalement privilégié pour sa meilleure capacité de traitement, alors que certaines applications de
présentation préfèrent les formes de présentation. L’ISO/IEC 10646 ne spécifie pas l’ordre de stockage
des formes de présentation; dans certaines réalisations, elles sont stockées en ordre inverse de celui
utilisé pour le codage intrinsèque. Par conséquent, il est recommandé, lors de la phase de préparation,
de s'assurer que les formes de présentation arabes et les autres caractères arabes soient fournis en
ordre logique à la méthode de comparaison.
Une table de tri adaptée peut être séparée en sections pour faciliter l’adaptation. On donne alors à
chaque section un nom, conformément aux dispositions de 6.3.1. Une des possibilités d’adaptation est
de donner un certain ordre à chaque section et de changer l’ordre relatif d’une section par rapport à
d’autres.
6.2.2 Méthode de référence de construction des clés
6.2.2.1 Généralités
Lorsque deux chaînes doivent être comparées pour déterminer leur ordre relatif, elles sont d’abord
analysées en séquences d’éléments de tri, en tenant compte des déclarations «collating-element» à
caractères multiples présentes dans la table de tri (si la syntaxe de 6.3.2 est utilisée). Dans la syntaxe
utilisée pour exprimer la table-modèle commune, le nom d’un élément de tri associé à un seul caractère
est formé de la lettre «U» suivie du numéro du caractère dans le JUC, en notation hexadécimale. Les
noms et caractères associés aux éléments de tri multicaractère sont définis par les déclarations
d’éléments de tri.
NOTE Les éléments de tri comportant plus de caractères sont préférés à ceux qui sont plus courts. Par
exemple, si un élément de tri comportant plusieurs caractères est défini pour «abc» et qu’un autre est défini pour
«ab» ou qu’un autre l’est pour «bc», alors, si «abc» se présente, l’élément de tri pour «abc» s’appliquera et non
celui pour «ab» ou «bc».
Une suite de m sous-clés intermédiaires est alors formée de chaque chaîne, m étant le nombre de
niveaux décrits dans une table de poids de tri adaptée.
Chaque clé de tri est une suite de sous-clés. Chaque sous-clé est une liste de poids numériques. Une
sous-clé est construite en ajoutant successivement la liste des poids attribués à chaque élément de
tri de la chaîne au niveau de la sous-c
...

INTERNATIONAL ISO
STANDARD 14651
Sixth edition
Information technology —
International string ordering and
comparison — Method for comparing
character strings and description
of the common template tailorable
ordering
Technologies de l'information — Classement international et
comparaison de chaînes de caractères — Méthode de comparaison de
chaînes de caractères et description du modèle commun et adaptable
d'ordre de classement
PROOF/ÉPREUVE
Reference number
ISO 14651:2020(E)
©
ISO 2020

---------------------- Page: 1 ----------------------
ISO 14651:2020(E)

COPYRIGHT PROTECTED DOCUMENT
© ISO/IEC 2020
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting
on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address
below or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii PROOF/ÉPREUVE © ISO/IEC 2020 – All rights reserved

---------------------- Page: 2 ----------------------
ISO 14651:2020(E)

Contents Page
Foreword .iv
Introduction .v
1 Scope . 1
2 Normative references . 2
3 Terms and definitions . 2
4 Symbols and conventions . 3
5 Conformance . 3
6 String comparison . 4
6.1 Preparation of character strings prior to comparison . 4
6.2 Key building and comparison. 5
6.2.1 Preliminary considerations . 5
6.2.2 Reference ordering key formation . . 6
6.2.3 Reference comparison method for ordering character strings . 8
6.2.4 Key ordering definition . 9
6.3 Common Template Table: Formation and interpretation .10
6.3.1 General.10
6.3.2 BNF syntax rules for the Common Template Table in Annex A .10
6.3.3 Well-formedness conditions .12
6.3.4 Interpretation of tailored tables .13
6.3.5 Evaluation of weight tables .15
6.3.6 Conditions for considering specific table equivalences .15
6.3.7 Conditions for results to be considered equivalent .15
6.4 Declaration of a delta .15
6.5 Name of the Common Template Table and name declaration .17
Annex A (normative) Common Template Table .18
Annex B (informative) Example tailoring deltas .20
Annex C (informative) Preparation .29
Annex D (informative) Tutorial on solutions brought by this document to problems of
lexical ordering .45
Annex E (informative) Searching and fuzzy matches .49
Bibliography .51
© ISO/IEC 2020 – All rights reserved PROOF/ÉPREUVE iii

---------------------- Page: 3 ----------------------
ISO 14651:2020(E)

Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that
are members of ISO or IEC participate in the development of International Standards through
technical committees established by the respective organization to deal with particular fields of
technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other
international organizations, governmental and non-governmental, in liaison with ISO and IEC, also
take part in the work.
The procedures used to develop this document and those intended for its further maintenance are
described in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for
the different types of document should be noted. This document was drafted in accordance with the
editorial rules of the ISO/IEC Directives, Part 2 (see www .iso .org/ directives).
Attention is drawn to the possibility that some of the elements of this document may be the subject
of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent
rights. Details of any patent rights identified during the development of the document will be in the
Introduction and/or on the ISO list of patent declarations received (see www .iso .org/ patents) or the IEC
list of patent declarations received (see patents.iec.ch).
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and
expressions related to conformity assessment, as well as information about ISO's adherence to the
World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT), see www .iso .org/
iso/ foreword .html.
This document was prepared by Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 2, Coded character sets.
This sixth edition cancels and replaces the fifth edition (ISO/IEC 14651:2019), which has been
technically revised.
The main changes compared to the previous edition are as follows:
— ordering data has been added for the new characters standardized in the sixth edition of
1)
ISO/IEC 10646 (2020) ;
— the content of 6.2.2 has been revised for more completeness;
— the weights of character U+A9B5 (JAVANESE VOWEL SIGN TOLONG) have been changed, as the
latter is considered a variant of character U+A9B4 (JAVANESE VOWEL SIGN TARUNG). This needed
to be fixed.
Any feedback or questions on this document should be directed to the user’s national standards body. A
complete listing of these bodies can be found at www .iso .org/ members .html.
1) Under preparation. Stage at time of PRF: ISO/IEC FDIS 10646:2020.
iv PROOF/ÉPREUVE © ISO/IEC 2020 – All rights reserved

---------------------- Page: 4 ----------------------
ISO 14651:2020(E)

Introduction
This document provides a method, applicable around the world, for ordering text data, and provides
a Common Template Table which, when tailored, can meet a given language’s ordering requirements
while retaining reasonable ordering for other scripts.
The Common Template Table requires some tailoring in different local environments. Conformance to
this document requires that all deviations from the template, called “deltas”, be declared to document
resultant discrepancies.
This document describes a method to order text data independently of context.
ISO/IEC TR 30112 has specifications for ordering that informatively complement the specifications in
this document and indicates where additional information can be sought on ordering keywords defined
in this document.
© ISO/IEC 2020 – All rights reserved PROOF/ÉPREUVE v

---------------------- Page: 5 ----------------------
INTERNATIONAL STANDARD ISO 14651:2020(E)
Information technology — International string ordering
and comparison — Method for comparing character
strings and description of the common template tailorable
ordering
1 Scope
This document defines the following.
— A reference comparison method. This method is applicable to two character strings to determine
their collating order in a sorted list. The method can be applied to strings containing characters from
the full repertoire of ISO/IEC 10646. This method is also applicable to subsets of that repertoire,
such as those of the different ISO/IEC 8-bit standard character sets, or any other character set,
standardized or not, to produce ordering results valid (after tailoring) for a given set of languages
for each script. This method uses collation tables derived either from the Common Template Table
defined in this document or from one of its tailorings. This method provides a reference format. The
format is described using the Backus-Naur Form (BNF). This format is used to describe the Common
Template Table. The format is used normatively within this document.
— A Common Template Table. A given tailoring of the Common Template Table is used by the reference
comparison method. The Common Template Table describes an order for all characters encoded
[27]
in the Unicode 13.0 standard, included in ISO/IEC 10646:2020. It allows for a specification of
a fully deterministic ordering. This table enables the specification of a string ordering adapted to
local ordering rules, without requiring an implementer to have knowledge of all the different scripts
already encoded in the Universal Coded Character Set (UCS).
NOTE 1 This Common Template Table is to be modified to suit the needs of a local environment. The main
worldwide benefit is that, for other scripts, often no modification is required and the order will remain as
consistent as possible and predictable from an international point of view.
NOTE 2 The character repertoire used in this document is equivalent to that of the Unicode Standard
[27]
version 13.0 .
— A reference name. The reference name refers to this particular version of the Common Template
Table, for use as a reference when tailoring. In particular, this name implies that the table is linked
to a particular stage of development of the ISO/IEC 10646 Universal coded character set.
— Requirements for a declaration of the differences (delta) between the collation table and the Common
Template Table.
This document does not mandate the following.
— A specific comparison method; any equivalent method giving the same results is acceptable.
— A specific format for describing or tailoring tables in a given implementation.
— Specific symbols to be used by implementations, except for the name of the Common Template Table.
— Any specific user interface for choosing options.
— Any specific internal format for intermediate keys used when comparing, nor for the table used. The
use of numeric keys is not mandated either.
— A context-dependent ordering.
— Any particular preparation of character strings prior to comparison.
© ISO/IEC 2020 – All rights reserved PROOF/ÉPREUVE 1

---------------------- Page: 6 ----------------------
ISO 14651:2020(E)

NOTE 1 It is normally necessary to do preparation of character strings prior to comparison even if it is not
prescribed by this document (see Annex C).
NOTE 2 Annex D describes problems that gave way to this International Standard with their anticipated
solutions.
2 Normative references
The following documents are referred to in the text in such a way that some or all of their content
constitutes requirements of this document. For dated references, only the edition cited applies. For
undated references, the latest edition of the referenced document (including any amendments) applies.
ISO/IEC 10646:2020, Information technology — Universal Coded Character Set (UCS)
3 Terms and definitions
For the purposes of this document, the following terms and definitions apply.
ISO and IEC maintain terminological databases for use in standardization at the following addresses:
— IEC Electropedia: available at http:// www .electropedia .org/
— ISO Online browsing platform: available at https:// www .iso .org/ obp
3.1
character string
sequence of characters considered as a single object
Note 1 to entry: Note to entry: A character string to be ordered does not normally include the characters that
delimit it, as for example an “end of line” control character in a text file to be sorted.
3.2
collating symbol
symbol (3.12) used to specify weights assigned to a collating element (3.4)
3.3
collation table
weighting table
mapping from collating elements (3.4) to weighting elements (3.14)
3.4
collating element
sequence of one or more characters that are considered a single entity for ordering (3.7)
3.5
delta
list of the differences between a given collation table (3.3) and another one
Note 1 to entry: The given collation table, together with a given delta, forms a new collation table.
Note 2 to entry: Unless otherwise specified in this document, the term “delta” always refers to differences from
the Common Template Table as defined in this document.
3.6
level
collation level
sequence number for a subkey (3.11) in the series of subkeys forming a key
2 PROOF/ÉPREUVE © ISO/IEC 2020 – All rights reserved

---------------------- Page: 7 ----------------------
ISO 14651:2020(E)

3.7
ordering
collation
process by which, given two strings, it is determined whether the first one is less than, equal to, or
greater than the second one
3.8
ordering key
sequence of subkeys (3.11) used to determine an order
3.9
preparation
collation preparation
process in which given character strings (3.1) are mapped to (other) character strings before the
calculation of the ordering key (3.8) for each of the strings
3.10
reference comparison method
method for establishing an order between two ordering keys (3.8)
Note 1 to entry: See Clause 6.
3.11
subkey
sequence of weights computed for a character string (3.1)
3.12
symbol
collating element (3.4)
3.13
weight
collation weight
positive integer value, used in subkeys (3.11), reflecting the relative order of collating elements (3.4)
3.14
weighting element
list of a given number of weights sequentially ordered by level
4 Symbols and conventions
Following ISO/IEC 10646, characters are referenced as UX where X stands for a series of one to eight
hexadecimal digits (where all the letters in the hexadecimal string are in upper case) and refers to the
value of that character in ISO/IEC 10646. This convention is used throughout this document.
In the Common Template Table, arbitrary symbols representing weights are used according to the BNF
notation description in 6.3.1.
5 Conformance
A process is conformant to this document if it produces results identical to those that result from the
application of the specifications given in 6.2 to 6.5.
A declaration of conformity to this document shall be accompanied by a statement, either directly or by
reference, of the following:
— the number of levels that the process supports; this number shall be at least three;
— whether the process supports the forward position processing parameter;
© ISO/IEC 2020 – All rights reserved PROOF/ÉPREUVE 3

---------------------- Page: 8 ----------------------
ISO 14651:2020(E)

— whether the process supports the backward processing parameter and at which level;
— the tailoring delta described in 6.4 and how many levels are defined in the delta;
— if a preparation process is used, the method used shall be declared.
It is the responsibility of implementers to show how their delta declaration is related to the table syntax
described in 6.3, and how the comparison method they use, if different from the one mentioned in
Clause 6, can be considered as giving the same results as those prescribed by the method specified in
Clause 6. The use of a preparation process is optional and its details are not specified in this document.
It is strongly recommended that processes present available tailoring options to users.
6 String comparison
6.1 Preparation of character strings prior to comparison
It can be necessary to transform character strings before the reference comparison method is applied
to them. Although not part of the Scope of this document, preparation can be an important part of the
ordering process. See Annex C for some examples of preparation.
Characters of the input string shall be encoded according to ISO/IEC 10646 (UCS) or a mapping to
ISO/IEC 10646 shall be provided if another encoding scheme is used.
Therefore it can be an important part of the preparation phase to map characters from a non-UCS
encoding scheme to the UCS for input to the comparison method. This task can, amongst other things,
encompass the correct handling of escape sequences in the originating encoding scheme, the mapping
of characters without an allocated UCS codepoint to an application-defined codepoint in the private
zone area and change the sequence of characters in strings that are not stored in logical order. For
example, for visual order Arabic code sets, input strings shall be put into logical order; and for some
bibliographic code sets, strings with combining accents stored before their respective base character
require that the combining accents be put after their base character. The resulting string sequence may
then have to be remapped into its original encoding scheme.
The Common Template Table is designed so that combining sequences and corresponding single
characters (precomposed) will have precisely the same ordering. To avoid inadvertently breaking
this invariant (and in the process breaking Unicode conformance), tailoring should reorder combining
sequences when corresponding precomposed characters are reordered. For example, if Ä is reordered
after Z, then the sequence + should also be reordered. To avoid exposing
encoding differences that can be invisible to the end-user, it is recommended that strings be normalized
[29]
according to Unicode normalization form NFD to achieve this equivalence (see ).
Escape sequences and control characters constitute very sensitive data to interpret, and it is highly
recommended that preparation should filter out or transform these sequences.
NOTE Since the reference method is a logical statement for the mechanism for string comparison, it does not
preclude an implementation from using a non-UCS character encoding only, as long as it produces results as if it
were using the reference comparison method.
4 PROOF/ÉPREUVE © ISO/IEC 2020 – All rights reserved

---------------------- Page: 9 ----------------------
ISO 14651:2020(E)

6.2 Key building and comparison
6.2.1 Preliminary considerations
6.2.1.1 Assumptions
The collation table is a mapping from collating elements to weighting elements. In each weighting
element, four levels are described in the Common Template Table. This number of levels can be extended
or reduced, but cannot be less than 3, in tailoring.
NOTE In the Common Template Table, levels generally have the following characteristics, although this
purpose is not absolute.
Level 1: This level generally corresponds to the set of common letters of the alphabets for that script, if the script
is alphabetic, and to the set of common characters of the script if the script is ideographic or syllabic.
Level 2: This level generally corresponds to diacritical marks affecting each basic character of the script. For
some languages, letters with diacritics are always considered an integral part of the basic letters of the alphabet
and are not considered at this second level, but rather at the first. For example, in Spanish, N TILDE is considered
a basic letter of the Latin script. Therefore, tailoring for Spanish will change the definition of N TILDE from "the
weight of an N in the first level and the weight of a TILDE in the second level" to "the weight of an N TILDE (placed
after N and before O) in the first level, and indication of the absence of a diacritic in the second level". For some
characters, variant letter shapes are also dealt with on level 2. An example of this is ß, the LATIN SMALL LETTER
SHARP S, which is treated as equivalent to ss on level 1, but traditionally distinguished from it on level 2.
Level 3: This level generally corresponds to case distinctions (upper and lower case) or to distinctions based on
variant letter shapes (like the distinction between Hiragana and Katakana).
Level 4: This level generally corresponds to weighting differences that are less significant than those at the other
levels. Often the last level (level 4 in the Common Template Table) is intended to specify additional weighting for
"special" characters, i.e. characters normally not part of the spelling of words of a language (such as dingbats,
punctuation, etc.), sometimes called "ignorable" characters in the context of computerized ordering.
6.2.1.2 Processing properties
A given tailored table has specific scanning and ordering properties. These properties can have been
changed by the tailoring.
A scanning direction (forward or backward) for each level is used to indicate how to process the string.
The scanning direction is a global property of each level defined in the tailored table.
If the last level is greater than three, there is an optional property of this level of comparison called
“position” option: when active, a comparison on the numeric position of each “ignorable” character in
the two strings is effected, before comparing their weights. In other words, for two strings equivalent
at all levels except the last one, the string having an ignorable character in the lowest position comes
before the other one. In case corresponding ignorable characters are at the same position, then their
weights are considered, until a difference is found. Support for this kind of processing is optional and is
not necessary to claim conformance to this document.
NOTE The scanning direction (forward or backward) is not normally related to the natural writing direction
of scripts. The scanning direction applies to the logical sequence of the coded character string.
According to ISO/IEC 10646, for scripts written right to left, such as Arabic, the first characters in
the logical sequence correspond to the rightmost characters in their natural presentation sequence.
Conversely, for the Latin script, written left to right, the first characters in the logical sequence
correspond to the leftmost characters in their natural presentation sequence.
Scanning forward starts with the lowest position in the logical sequence, while scanning backward
starts from the highest position, independently of the presentation sequence. The scanning direction
for ordering purposes is a global property of each level described in the table.
© ISO/IEC 2020 – All rights reserved PROOF/ÉPREUVE 5

---------------------- Page: 10 ----------------------
ISO 14651:2020(E)

In ISO/IEC 10646, the Arabic script is artificially separated into two pseudo-scripts: 1) the logical,
intrinsic Arabic, coded independently of contextual shapes, and 2) the Arabic presentation forms.
Both allow the complete coding of Arabic, but intrinsic Arabic is normally preferred for better
processing, while presentation-form Arabic is preferred by some presentation-oriented applications.
ISO/IEC 10646 does not prescribe that the presentation forms be stored in any specific order, and
in some implementations, the storage order for the latter is the reverse of the storage order used for
intrinsic Arabic. It is therefore advisable that the preparation phase be used to make sure that Arabic
presentation forms and other Arabic characters be fed to the comparison method in logical order.
A tailored sort table can be separated into sections for ease of tailoring. Each section is then assigned
a name consistent with the specification in 6.3.1. One of the tailoring possibilities is to assign a given
order to each section and to change the relative order of an entire section relative to other sections.
6.2.2 Reference ordering key formation
6.2.2.1 General
When two strings are to be compared to determine their relative order, the two strings are first parsed
into a sequence of collating elements taking into account the multi-character “collating-element”
statements declared and used in a tailored table (if the syntax of 6.3.2 is used). For the syntax used for
expressing the Common Template Table, the name of a collating element consisting of a single character,
is formed by the UCS value of the character, expressed as a hexadecimal string, prefixed with “U”.
For multi-character collating elements, the name and association to characters can be found via the
collating elements declarations.
NOTE Collating elements with more characters have preference over shorter ones. As an example, if a
multicharacter collating element is defined for “abc” and another one is defined for “ab” or for “bc”, then if “abc” is
encountered, the collating element for “abc” will apply and not the one for “ab” or “bc”.
Then, a sequence of m intermediary subkeys is formed out of a character string, where m is the number
of levels described in a tailored collation weighting table.
Each ordering key is a sequence of subkeys. Each subkey is a list of numeric weights. A subkey is formed
by successively appending the list of the weights assigned, at the level of the subkey, to each collating
element of the string. The keyword “IGNORE” in the Common Template Table at the place of a sequence
of collating symbols at a level indicates that the sequence of weights at that level for that collating
element is an empty sequence of weights.
6.2.2.2 Weighting elements to be ignored
When forming a sort key, collating elements ignored at the first level or at the two first levels and that
follow a collation element ignored at all levels but the last one, do not keep their weights as defined in
the common template table (or a tailored table); each of these weights shall be zeroed (this means that
“IGNORE” shall be assigned to each non-nil weight).
6.2.2.3 Implicit weights computing
If there is no entry in the tailored table for a character of the input string, then the character’s weights
are undefined. In this case, one shall compute an “implicit” primary weight consisting of a pair of 16-
bit words — call them “aaaa” and “bbbb” — and assume that lines like the following were added to the
weighting table:
"";;;
16 16
NOTE (at the last level) is the largest level 1 weight in the Common Template Table.
6 PROOF/ÉPREUVE © ISO/IEC 2020 – All rights reserved

---------------------- Page: 11 ----------------------
ISO 14651:2020(E)

Distinctions are needed among characters with no entry in the weighting table, and implicit primary
weights are thus compu
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.