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

ISO/IEC 14651:2016 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 International Standard 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 International Standard. - 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 8.0 standard, included in ISO/IEC 10646:2014 and its Amendment 1. 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 International Standard is equivalent to that of the Unicode Standard version 6.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 International Standard 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 It is normally necessary to do preparation of character strings prior to comparison even if it is not prescribed by this International Standard (see Annex C). Although no user interface is required to choose options or to specify tailoring of the Common Template Table, conformance requires always declaring the applicable delta, a declaration of differences with this table. It is recommended that processes present available tailoring options to users.

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

L'ISO/IEC 14651:2016 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/CEI 10646, des sous-répertoires tels que ceux des divers jeux normalisés ISO/CEI à 8 bits ou tout autre jeu de caractères, 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 la présente Norme internationale, 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). Son emploi est normatif dans l'ISO/IEC 14651:2016. 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 8.0 compris dans l'ISO/CEI 10646:2014 et son amendement 1. 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). 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/CEI 10646). Des exigences pour la déclaration de différences (delta) entre une table de tri et la table-modèle commune. L'ISO/IEC 14651:2016 ne prescrit 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 mise 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 prescrite non plus. Un ordre dépendant du contexte. Un prétraitement particulier des chaînes de caractères avant comparaison.

General Information

Status
Withdrawn
Publication Date
16-Feb-2016
Withdrawal Date
16-Feb-2016
Current Stage
9599 - Withdrawal of International Standard
Completion Date
30-Jan-2019
Ref Project

Relations

Buy Standard

Standard
ISO/IEC 14651:2016 - Information technology -- International string ordering and comparison -- Method for comparing character strings and description of the common template tailorable ordering
English language
50 pages
sale 15% off
Preview
sale 15% off
Preview
Standard
ISO/IEC 14651:2016 - Information technology -- International string ordering and comparison -- Method for comparing character strings and description of the common template tailorable ordering
English language
50 pages
sale 15% off
Preview
sale 15% off
Preview
Standard
ISO/IEC 14651:2016 - Technologies de l'information -- Classement international et comparaison de chaînes de caracteres -- Méthode de comparaison de chaînes de caracteres et description du modele commun et adaptable d'ordre de classement
French language
51 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

INTERNATIONAL ISO/IEC
STANDARD 14651
Fourth edition
2016-02-15
Corrected version
2016-05-01
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:2016(E)
©
ISO/IEC 2016

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

COPYRIGHT PROTECTED DOCUMENT
© ISO/IEC 2016, Published in Switzerland
All rights reserved. Unless otherwise specified, 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
Ch. de Blandonnet 8 • CP 401
CH-1214 Vernier, Geneva, Switzerland
Tel. +41 22 749 01 11
Fax +41 22 749 09 47
copyright@iso.org
www.iso.org
ii © ISO/IEC 2016 – All rights reserved

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

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

---------------------- Page: 3 ----------------------
ISO/IEC 14651:2016(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. In the field of information technology, ISO and IEC have established a joint technical committee,
ISO/IEC JTC 1.
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).
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation on the meaning of ISO specific terms and expressions related to conformity
assessment, as well as information about ISO’s adherence to the WTO principles in the Technical
Barriers to Trade (TBT) see the following URL: Foreword - Supplementary information
The committee responsible for this document is ISO/IEC JTC 1, Information technology, SC 2, Coded
character sets.
This fourth edition cancels and replaces the third edition (ISO/IEC 14651:2011), which has been
technically revised.
This corrected version of ISO/IEC 14651:2016 incorporates the following corrections: in Annex C, Thai
characters have been corrected.
iv © ISO/IEC 2016 – All rights reserved

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

Introduction
This International Standard 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 International Standard requires that all deviations from the template, called “deltas”, be declared
to document resultant discrepancies.
This International Standard 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 International Standard and indicates where additional information can be sought on ordering
keywords defined in this International Standard.
© ISO/IEC 2016 – All rights reserved v

---------------------- Page: 5 ----------------------
INTERNATIONAL STANDARD ISO/IEC 14651:2016(E)
Information technology — International string ordering
and comparison — Method for comparing character
strings and description of the common template tailorable
ordering
1 Scope
This International Standard 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 International Standard 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 International Standard.
— 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 8.0 standard, included in ISO/IEC 10646:2014 and its Amendment 1. 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 International Standard is equivalent to that of the Unicode
Standard version 6.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 International Standard 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 2016 – All rights reserved 1

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

NOTE It is normally necessary to do preparation of character strings prior to comparison even if it is not
prescribed by this International Standard (see Annex C).
Although no user interface is required to choose options or to specify tailoring of the Common Template
Table, conformance requires always declaring the applicable delta, a declaration of differences with
this table. It is recommended that processes present available tailoring options to users.
2 Conformance
A process is conformant to this International Standard 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 International Standard 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;
— 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
International Standard.
3 Normative references
The following referenced documents, in whole or in part, are normatively referenced in this document
and are indispensable for its application. For undated references, the latest edition of the referenced
document (including any amendments) applies.
ISO/IEC 10646:2014, Information technology — Universal Coded Character Set (UCS)
ISO/IEC 10646:2014/Amd.1:2015, Information technology — Universal Coded Character Set (UCS) /
Amendment 1: Cherokee supplement and other characters
4 Terms and definitions
For the purposes of this document, the following terms and definitions apply.
4.1
character string
sequence of characters considered as a single object
4.2
collating symbol
symbol (4.12) used to specify weights assigned to a collating element (4.4)
4.3
collation (weighting) table
mapping from collating elements (4.4) to weighting elements (4.14)
2 © ISO/IEC 2016 – All rights reserved

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

4.4
collating element
sequence of one or more characters that are considered a single entity for ordering (4.7)
4.5
delta
list of the differences between a given collation table (4.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 International Standard, the term “delta” always refers to
differences from the Common Template Table as defined in this International Standard.
4.6
(collation) level
sequence number for a subkey (4.11) in the series of subkeys forming a key
4.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
4.8
ordering key
sequence of subkeys (4.11) used to determine an order
4.9
(collation) preparation
process in which given character strings (4.1) are mapped to (other) character strings before the
calculation of the ordering key (4.8) for each of the strings
4.10
reference comparison method
method for establishing an order between two ordering keys (4.8)
Note 1 to entry: See Clause 6.
4.11
subkey
sequence of weights computed for a character string (4.1)
4.12
symbol
collating element (4.4)
4.13
(collation) weight
positive integer value, used in subkeys (4.11), reflecting the relative order of collating elements (4.4)
4.14
weighting element
list of a given number of weights sequentially ordered by level
5 Symbols and abbreviations
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 International
Standard.
© ISO/IEC 2016 – All rights reserved 3

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

In the Common Template Table, arbitrary symbols representing weights are used according to the BNF
notation description in 6.3.1.
6 String comparison
6.1 Preparation of character strings prior to comparison
It may be necessary to transform character strings before the reference comparison method is applied
to them (see Annex C for an example of such preparation). Although not part of the Scope of this
International Standard, preparation may be an important part of the ordering process. See Annex C for
some examples of preparation.
Where applicable, 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 may be invisible to the end-user, it is recommended that strings be normalized
according to Unicode normalization form NFD to achieve this equivalence (see Unicode Technical
Report no. 15).
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.
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
4 © ISO/IEC 2016 – All rights reserved

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

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 may 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 International Standard.
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.
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 may 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.
© ISO/IEC 2016 – All rights reserved 5

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

6.2.2 Reference ordering key formation
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.1 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.
There are three ways of forming subkeys: subkeys formed using the “forward” processing parameter,
subkeys formed using the “backward” processing parameter, and subkeys formed using the
“forward,position” processing parameter. Subkeys that use the “position” option can only occur
at the last level, and only if that level is greater than three. Support of the “position” option is not
required for conformance. If the processing parameter “forward, position” is not supported,
“forward,position” shall be interpreted as if the processing parameter had been “forward”.
If there is no entry in the tailored table for a character of the input string, then the character’s weights
are undefined. Characters with undefined weights should be ordered, with respect to characters that
have defined weights, as if the undefined ones were given the weight named “UNDEFINED” at the
first level. If there is no weight assignment to the symbol “UNDEFINED” before the symbol ’s
weight assignment in a given tailored table, then the table shall be interpreted as if “UNDEFINED” was
weighted just before . The ordering of characters with undefined weights with respect to other
characters with undefined weights is not specified in this International Standard.
NOTE 1 A possible way to order characters with undefined weights is as if there were tailoring lines like this
one added to the table, in UCS code point order (call the maximal level 4 weight here):
“”;;;
NOTE 2 is the maximal level 1 weight in the Common Template Table.
6.2.2.1 Formation of a subkey with the “forward” level processing parameter
Subkeys, at a particular level, formed with the “forward” level processing parameter, are built in the
following way:
During forward scanning of each collating element of the input character string, one or more weights are
obtained. These weights are obtained by matching the collating element in the given tailored collation
weighting table, obtaining the list of weights assigned to the collating element at the particular level.
The obtained weight list is appended to the end of the subkey.
6.2.2.2 Formation of a subkey with the “backward” level processing parameter
Subkeys, at a particular level, formed with the “backward” level
...

DRAFT INTERNATIONAL STANDARD
ISO/IEC DIS 14651
ISO/IEC JTC 1/SC 2 Secretariat: JISC
Voting begins on: Voting terminates on:
2015-07-20 2015-10-20
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
ICS: 35.040
THIS DOCUMENT IS A DRAFT CIRCULATED
FOR COMMENT AND APPROVAL. IT IS
THEREFORE SUBJECT TO CHANGE AND MAY
NOT BE REFERRED TO AS AN INTERNATIONAL
STANDARD UNTIL PUBLISHED AS SUCH.
IN ADDITION TO THEIR EVALUATION AS
BEING ACCEPTABLE FOR INDUSTRIAL,
TECHNOLOGICAL, COMMERCIAL AND
USER PURPOSES, DRAFT INTERNATIONAL
STANDARDS MAY ON OCCASION HAVE TO
BE CONSIDERED IN THE LIGHT OF THEIR
POTENTIAL TO BECOME STANDARDS TO
WHICH REFERENCE MAY BE MADE IN
Reference number
NATIONAL REGULATIONS.
ISO/IEC DIS 14651:2015(E)
RECIPIENTS OF THIS DRAFT ARE INVITED
TO SUBMIT, WITH THEIR COMMENTS,
NOTIFICATION OF ANY RELEVANT PATENT
RIGHTS OF WHICH THEY ARE AWARE AND TO
©
PROVIDE SUPPORTING DOCUMENTATION. ISO/IEC 2015

---------------------- Page: 1 ----------------------
ISO/IEC DIS 14651:2015(E)

COPYRIGHT PROTECTED DOCUMENT
© ISO/IEC 2015, Published in Switzerland
All rights reserved. Unless otherwise specified, 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
Ch. de Blandonnet 8 • CP 401
CH-1214 Vernier, Geneva, Switzerland
Tel. +41 22 749 01 11
Fax +41 22 749 09 47
copyright@iso.org
www.iso.org
ii © ISO/IEC 2015 – All rights reserved

---------------------- Page: 2 ----------------------
ISO/IEC 14651:2011(E)
Contents Page
Foreword . v
Introduction . vi
1 Scope . 1
2 Conformance . 2
3 Normative references . 2
4 Terms and definitions . 2
5 Symbols and abbreviations . 4
6 String comparison . 4
6.1 Preparation of character strings prior to comparison . 4
6.2 Key building and comparison . 4
6.2.1 Preliminary considerations . 4
6.2.2 Reference ordering key formation . 6
6.2.3 Reference comparison method for ordering character strings . 7
6.3 Common Template Table: formation and interpretation . 8
6.3.1 BNF syntax rules for the Common Template Table in Annex A . 8
6.3.2 Well-formedness conditions . 11
6.3.3 Interpretation of tailored tables . 12
6.3.4 Evaluation of weight tables . 14
6.3.5 Conditions for considering specific table equivalences . 14
6.3.6 Conditions for results to be considered equivalent . 14
6.4 Declaration of a delta . 14
6.5 Name of the Common Template Table and name declaration . 16
Annex A (normative) Common Template Table . 17
Annex B (informative) Example tailoring deltas . 19
B.1 Example 1 — Minimal tailoring . 19
B.2 Example 2 — Reversing the order of lowercase and uppercase letters . 19
B.3 Example 3 — Canadian delta and benchmark . 19
B.4 Example 4 — Danish delta and benchmark . 22
B.5 Example 5 — A tailoring for Khmer . 25
Annex C (informative) Preparation . 27
C.1 General considerations . 27
C.2 Thai string ordering . 27
C.2.1 Thai ordering principles . 28
C.2.2 Vowel/consonant rearrangement . 28
C.2.3 Example ordered strings . 30
C.3 Handling of numeral substrings in collation . 30
C.3.1 Handling of ‘ordinary’ numerals for natural numbers . 31
C.3.2 Handling of positional numerals in other scripts . 33
C.3.3 Handling of other non-pure positional system numerals or non-positional system
numerals (e.g. Roman numerals) . 33
C.3.4 Handling of numerals for whole numbers . 34
C.3.5 Handling of positive positional numerals with fractional parts . 35
C.3.6 Handling of positive positional numerals with fraction parts and exponent parts . 36
C.3.7 Handling of date and time of day indications . 37
C.3.8 Making numbers less significant than letters . 38
C.3.9 Maintaining determinacy . 38
C.4 Preprocessing Hangul . 39
© ISO/IEC 2011 – All rights reserved iii

---------------------- Page: 3 ----------------------
ISO/IEC 14651:2011(E)
C.4.1 Step 1 .39
C.4.2 Step 2 .39
C.4.3 Step 3 .40
C.4.4 Step 4 .40
Annex D (informative) Tutorial on solutions brought by this International Standard to problems of
lexical ordering .41
D.1 Problems .41
D.2 Solution .42
D.3 Tailoring .43
Annex E (informative) Searching and fuzzy matches .45
Bibliography .47

iv © ISO/IEC 2011 – All rights reserved

---------------------- Page: 4 ----------------------
ISO/IEC 14651:2011(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. In the field of information
technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1.
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).
For an explanation on the meaning of ISO specific terms and expressions related to conformity assessment,
as well as information about ISO's adherence to the WTO principles in the Technical Barriers to Trade (TBT)
see the following URL: Foreword - Supplementary information.
The committee responsible for this document is ISO/IEC JTC 1, Information technology, SC 2, Coded
character sets.
This fourth edition cancels and replaces the third edition (ISO/IEC 14651:2011), which has been technically
revised.
© ISO/IEC 2011 – All rights reserved v

---------------------- Page: 5 ----------------------
ISO/IEC 14651:2011(E)
Introduction
This International Standard 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
International Standard requires that all deviations from the Template, called “deltas”, be declared to document
resultant discrepancies.
This International Standard describes a method to order text data independently of context.
ISO/IEC TR 14652 has specifications for ordering that informatively complement the specifications in this
International Standard, and indicates where additional information can be sought on ordering keywords
defined in this International Standard.
vi © ISO/IEC 2011 – All rights reserved

---------------------- Page: 6 ----------------------
INTERNATIONAL STANDARD ISO/IEC 14651:2011(E)

Information technology — International string ordering and
comparison — Method for comparing character strings and
description of the common template tailorable ordering
1 Scope
This International Standard 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 International
Standard 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 International Standard.
 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 8.0 standard, included in ISO/IEC 10646:2014 and its amendment 1. 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 International Standard is equivalent to that of the Unicode Standard
version 6.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 International Standard 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.
© ISO/IEC 2011 – All rights reserved 1

---------------------- Page: 7 ----------------------
ISO/IEC 14651:2011(E)
 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 International Standard (see Annex C).
NOTE 2 Although no user interface is required to choose options or to specify tailoring of the Common Template Table,
conformance requires always declaring the applicable delta, a declaration of differences with this table. It is recommended
that processes present available tailoring options to users.
2 Conformance
A process is conformant to this International Standard 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 International Standard 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.
 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 International Standard.
3 Normative references
The following referenced documents are indispensable for the application 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:2014, Information technology — Universal Coded Character Set (UCS) (UCS)
ISO/IEC 10646:2014/Amd.1:2015, Information technology — Universal Coded Character Set (UCS) —
Amendment 1 – Cherokee supplement and other characters
4 Terms and definitions
For the purposes of this document, the following terms and definitions apply.
4.1
character string
sequence of characters considered as a single object
2 © ISO/IEC 2011 – All rights reserved

---------------------- Page: 8 ----------------------
ISO/IEC 14651:2011(E)
4.2
collating symbol
symbol used to specify weights assigned to a collating element
4.3
collation (weighting) table
mapping from collating elements to weighting elements
4.4
collating element
sequence of one or more characters that are considered a single entity for ordering
4.5
delta
list of the differences between a given collation table and another one
NOTE 1 The given collation table, together with a given delta, forms a new collation table.
NOTE 2 Unless otherwise specified in this International Standard, the term “delta” always refers to differences from the
Common Template Table as defined in this International Standard.
4.6
(collation) level
sequence number for a subkey in the series of subkeys forming a key
4.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
4.8
ordering key
sequence of subkeys used to determine an order
4.9
(collation) preparation
process in which given character strings are mapped to (other) character strings before the calculation of the
ordering key for each of the strings
4.10
reference comparison method
method for establishing an order between two ordering keys
NOTE 1 See Clause 6.
4.11
subkey
sequence of weights computed for a character string
4.12
symbol
collating element
4.13
(collation) weight
positive integer value, used in subkeys, reflecting the relative order of collating elements
© ISO/IEC 2011 – All rights reserved 3

---------------------- Page: 9 ----------------------
ISO/IEC 14651:2011(E)
4.14
weighting element
list of a given number of weights sequentially ordered by level
5 Symbols and abbreviations
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 International Standard.
In the Common Template Table arbitrary symbols representing weights are used according to the BNF
notation description in 6.3.1.
6 String comparison
6.1 Preparation of character strings prior to comparison
It may be necessary to transform character strings before the reference comparison method is applied to them
(see Annex C for an example of such preparation). Although not part of the scope of this International
Standard, preparation may be an important part of the ordering process. See Annex C for some examples of
preparation.
Where applicable, 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 must 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.
NOTE 1 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 may be invisible to the end-user, it is recommended that
strings be normalized according to Unicode normalization form NFD to achieve this equivalence – see Bibliography,
Unicode Technical Report no. 15.
NOTE 2 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 3 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.
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 can not be less than 3, in tailoring.
4 © ISO/IEC 2011 – All rights reserved

---------------------- Page: 10 ----------------------
ISO/IEC 14651:2011(E)
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 may 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 International Standard.
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.
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 may 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.
© ISO/IEC 2011 – All rights reserved 5

---------------------- Page: 11 ----------------------
ISO/IEC 14651:2011(E)
6.2.2 Reference ordering key formation
When two strings are to be compared to determine their relative order, the
...

NORME ISO/IEC
INTERNATIONALE 14651
Quatrième édition
2016-02-15
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:2016(F)
©
ISO/IEC 2016

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

DOCUMENT PROTÉGÉ PAR COPYRIGHT
© ISO/IEC 2016, Publié en Suisse
Droits de reproduction réservés. Sauf indication contraire, 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, l’affichage sur
l’internet ou sur un Intranet, sans autorisation écrite préalable. Les demandes d’autorisation peuvent être adressées à l’ISO à
l’adresse ci-après ou au comité membre de l’ISO dans le pays du demandeur.
ISO copyright office
Ch. de Blandonnet 8 • CP 401
CH-1214 Vernier, Geneva, Switzerland
Tel. +41 22 749 01 11
Fax +41 22 749 09 47
copyright@iso.org
www.iso.org
ii  © ISO/IEC 2016 – Tous droits réservés

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

Sommaire Page
Avant-propos .iv
Introduction .v
1 Domaine d’application . 1
2 Conformité . 2
3 Références normatives . 2
4 Termes et définitions . 2
5 Symboles et abréviations . 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 . 4
6.2.1 Préliminaires . 4
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. 7
6.3 Table-modèle commune: composition et interprétation. 8
6.3.1 Règles de syntaxe BNF pour la table-modèle commune de l’Annexe A . . 8
6.3.2 Contraintes de forme . .11
6.3.3 Interprétation des tables adaptées .12
6.3.4 Évaluation des tables de poids .13
6.3.5 Conditions d’équivalence de tables spécifiques .13
6.3.6 Conditions d’équivalence des résultats .14
6.4 Déclaration d’un delta .14
6.5 Nom de la table-modèle commune et déclaration de nom .16
Annexe A (normative) Table-modèle commune .17
Annexe B (informative) Exemples de deltas d’adaptation .19
Annexe C (informative) Prétraitement .28
Annexe D (informative) Annexe didactique sur les solutions apportées par la présente
Norme internationale aux problèmes de tri lexical .44
Annexe E (informative) Recherches et correspondances floues .48
Bibliographie .50
© ISO/IEC 2016 – Tous droits réservés iii

---------------------- Page: 3 ----------------------
ISO/IEC 14651:2016(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. Dans le domaine
des technologies de l’information, l’ISO et l’IEC ont créé un comité technique mixte, l’ISO/IEC JTC 1.
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 appelé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 la CEI 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).
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 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’OMC concernant les obstacles techniques au commerce (OTC), voir le lien suivant: Avant-propos —
Informations supplémentaires.
Le comité chargé de l’élaboration du présent document est l’ISO/CEI/JTC 1, Technologies de l’information,
sous-comité SC 2, Jeux de caractères codés.
Cette quatrième édition annule et remplace la troisième édition (ISO/CEI 14651:2011), qui a fait l’objet
d’une révision technique.
La  présente  version  française  de  l’ISO 14651:2016  correspond  à  la version  anglaise  corrigée du
2016-05-01.
iv © ISO/IEC 2016 – Tous droits réservés

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

Introduction
La présente Norme internationale fournit une méthode universelle de mise en ordre des données
textuelles. Elle fournit également une table-modèle commune qui, lorsque 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 telle sorte qu’une adaptation s’avère nécessaire pour chaque
environnement local. C’est pourquoi la conformité à la présente Norme internationale 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.
La présente Norme Internationale décrit une méthode pour classer l’information textuelle de manière
indépendante du contexte.
L’ISO/CEI/TR 30112 contient des dispositions complémentaires pour le tri à celle de la présente Norme
internationale; on y trouvera aussi des renseignements complémentaires sur les mots-clés de tri définis
dans la présente Norme internationale.
© ISO/IEC 2016 – Tous droits réservés v

---------------------- Page: 5 ----------------------
NORME INTERNATIONALE ISO/IEC 14651:2016(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
La présente Norme internationale 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/CEI 10646, des sous-répertoires tels que ceux des divers
jeux normalisés ISO/CEI à 8 bits ou tout autre jeu de caractères, 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 la présente Norme internationale, 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). Son emploi est normatif dans la présente Norme internationale.
— 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 8.0 compris dans l’ISO/CEI 10646:2014
et son amendement 1. 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 la présente Norme internationale est équivalent à celui
du standard Unicode, version 6.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/CEI 10646).
— Des exigences pour la déclaration de différences (delta) entre une table de tri et la table-modèle
commune.
La présente Norme internationale ne prescrit 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 mise 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 prescrite non plus.
© ISO 2016 – Tous droits réservés 1

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

— Un ordre dépendant du contexte.
— Un prétraitement particulier des chaînes de caractères avant comparaison.
NOTE Bien que ceci ne soit pas prescrit par la présente Norme internationale, il s’avère souvent nécessaire
de préparer les chaînes de caractères avant leur comparaison (cf. l’Annexe C).
Bien que l’on ne prescrive aucune interface utilisateur destinée à choisir les options ou à adapter la
table-modèle commune, la conformité exige de toujours déclarer un delta, c’est-à-dire l’ensemble
des différences par rapport à cette table. Il est fortement recommandé que l’application présente à
l’utilisateur les options et adaptations disponibles.
2 Conformité
Un processus est conforme à la présente Norme internationale s’il produit des résultats identiques à
ceux qui résultent de l’application des spécifications décrites en 6.2 à 6.5.
Toute déclaration de conformité à la présente Norme internationale 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 prescrits 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 la présente Norme internationale.
3 Références normatives
Les documents de référence suivants sont indispensables pour l’application 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/CEI 10646:2014, Technologies de l’information — Jeu universel de caractères codés (JUC)
ISO/CEI 10646:1/Amd 1:2015, Technologies de l’information — Jeu universel de caractères codés (JUC)/
Amendment 1.
4 Termes et définitions
Pour les besoins du présent document, les termes et définitions suivants s’appliquent.
4.1
chaîne de caractères
suite de caractères considérée comme un objet simple
4.2
symbole de tri
symbole (4.12) utilisé pour préciser les poids attribués à un élément de tri (4.4)
2 © ISO/IEC 2016 – Tous droits réservés

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

4.3
table (de poids) de tri
table reliant les éléments de tri (4.4) aux éléments de poids (4.14)
4.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 (4.7)
4.5
delta
liste des différences que présente une table de classement (4.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ésignera les différences par rapport à la table-modèle
commune définie dans la présente Norme internationale.
4.6
niveau (de tri)
numéro d’une sous-clé (4.11) dans la série de sous-clés formant une clé
4.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
4.8
clé de tri
série de sous-clés (4.11) utilisée pour déterminer un ordre
4.9
prétraitement
procédé par lequel des chaînes de caractères (4.1) sont transformées en d’autres chaînes avant le calcul
de la clé de tri (4.8) de chaque chaîne
4.10
méthode de comparaison de référence
méthode de détermination de l’ordre relatif de deux clés de tri (4.8)
Note 1 à l’article: Voir l’Article 6.
4.11
sous-clé
suite de poids calculée pour une chaîne de caractères (4.1)
4.12
symbole
élément de tri (4.4)
4.13
poids (de tri)
entier positif, utilisé dans les sous-clés (4.11), pour indiquer l’ordre relatif des éléments de tri
4.14
élément de poids
liste d’un certain nombre de poids séquentiellement ordonnés par niveau
5 Symboles et abréviations
Selon l’ISO/CEI 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
© ISO/IEC 2016 – Tous droits réservés 3

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

majuscules) et où X est le numéro du caractère dans l’ISO/CEI 10646. Cette convention est reprise dans
la présente Norme internationale.
Dans la table-modèle commune, des symboles arbitraires représentent des poids selon la notation BNF
décrite en 6.3.1.
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 (l’Annexe C fournit un exemple d’une telle préparation). Bien que n’étant
pas l’objet de la présente Norme internationale, le prétraitement peut être une partie importante du
processus de tri. On consultera l’Annexe C pour des exemples de prétraitement.
S’il y a lieu, 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
re-transformée dans le codage original.
La table-modèle commune est conçue de telle 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), l’adaptation devrait changer le classement
des séquences combinatoires quand le classement des caractères précomposés correspondant
est changé. Par exemple, si Ä est déplacé après Z, alors le classement de la séquence combinatoire
+ devrait aussi être changé. Pour éviter de révéler des différences de codage
invisible à l’utilisateur, on recommande de normaliser les chaînes selon la forme FND de l’algorithme de
normalisation Unicode – voir le Unicode Technical Report n° 15 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.
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.
4 © ISO/IEC 2016 – Tous droits réservés

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

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»: lorsque 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é à la présente Norme internationale.
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/CEI 10646 prescrit 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.
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 pour fins
de tri est une propriété globale de chaque niveau décrit dans la table.
Dans l’ISO/CEI 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/CEI 10646 ne prescrit 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, la phase de préparation devrait 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
© ISO/IEC 2016 – Tous droits réservés 5

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

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
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ésents dans la table de tri (si la syntaxe de 6.3.1 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 multi-caractères 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 defini 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-clé en construction. Dans la table-modèle commune, le mot-clé
«IGNORE» trouvé en place d’une suite de poids à un niveau indique que la suite de poids à ce niveau
pour cet élément de tri est vide.
Il y a trois façons de former des sous-clés: vers l’avant (paramètre de traitement «forward»), vers
l’arrière (paramètre de traitement «backward») et de façon positionnelle (paramètre de traitement
«forward,position»). Les sous-clés formées de façon positionnelle ne peuvent apparaître qu’au
dernier niveau et seulement si ce niveau est supérieur à trois. La conformité n’exige pas la formation
de sous-clés de façon positionnelle; une réalisation incapable de formation positionnelle interprétera
«forward,position» comme s’il s’agissait de «forward».
Si la table adaptée ne contient pas d’entrée pour un caractère de la chaîne d’entrée, les poids de ce
caractère ne sont pas définis. Les caractères de poids indéfinis devraient être triés, par rapport aux
caractères ayant des poids définis, comme s’ils avaient le poids nommé «UNDEFINED» au premier
niveau. Si le symbole «UNDEFINED» n’a pas de poids attribué avant l’attribution d’un poids à symbole
dans la table adaptée, on considèrera que le poids de «UNDEFINED» est tout juste inférieur à
celui de . Le classement relatif des caractères de poi
...

Questions, Comments and Discussion

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