forked from w3c/charmod-norm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOverview.html
2329 lines (1997 loc) · 212 KB
/
Overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html><html dir="ltr" lang="en"><head><meta charset="UTF-8"><meta name="generator" content="ReSpec 24.2.3"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><style>/* --- EXAMPLES --- */
span.example-title {
text-transform: none;
}
aside.example, div.example, div.illegal-example {
padding: 0.5em;
margin: 1em 0;
position: relative;
clear: both;
}
div.illegal-example { color: red }
div.illegal-example p { color: black }
aside.example, div.example {
padding: .5em;
border-left-width: .5em;
border-left-style: solid;
border-color: #e0cb52;
background: #fcfaee;
}
aside.example div.example {
border-left-width: .1em;
border-color: #999;
background: #fff;
}
aside.example div.example span.example-title {
color: #999;
}
</style><style>/* --- ISSUES/NOTES --- */
div.issue-title, div.note-title , div.ednote-title, div.warning-title {
padding-right: 1em;
min-width: 7.5em;
color: #b9ab2d;
}
div.issue-title { color: #e05252; }
div.note-title, div.ednote-title { color: #2b2; }
div.warning-title { color: #f22; }
div.issue-title span, div.note-title span, div.ednote-title span, div.warning-title span {
text-transform: uppercase;
}
div.note, div.issue, div.ednote, div.warning {
margin-top: 1em;
margin-bottom: 1em;
}
.warning > p:first-child { margin-top: 0 }
.warning {
padding: .5em;
border-left-width: .5em;
border-left-style: solid;
}
div.issue, div.note , div.ednote, div.warning {
padding: 1em 1.2em 0.5em;
margin: 1em 0;
position: relative;
clear: both;
}
span.warning { padding: .1em .5em .15em; }
.issue {
border-color: #e05252;
background: #fbe9e9;
}
.issue.closed span.issue-number {
text-decoration: line-through;
}
.warning {
border-color: #f11;
border-width: .2em;
border-style: solid;
background: #fbe9e9;
}
.warning-title:before{
content: "⚠"; /*U+26A0 WARNING SIGN*/
font-size: 3em;
float: left;
height: 100%;
padding-right: .3em;
vertical-align: top;
margin-top: -0.5em;
}
li.task-list-item {
list-style: none;
}
input.task-list-item-checkbox {
margin: 0 0.35em 0.25em -1.6em;
vertical-align: middle;
}
.issue a.respec-gh-label {
padding: 5px;
margin: 0 2px 0 2px;
font-size: 10px;
text-transform: none;
text-decoration: none;
font-weight: bold;
border-radius: 4px;
position: relative;
bottom: 2px;
}
.issue a.respec-label-dark {
color: #fff;
background-color: #000;
}
.issue a.respec-label-light {
color: #000;
background-color: #fff;
}
</style>
<!--
Editor's note: the current list of Unicode characters used in this document is:
U+0130 U+0131 U+0133 U+0141 U+017E U+01C4 U+01C5 U+01C6 U+01FA U+0300 U+0301 U+0307 U+030A U+0323 U+0327 U+0342 U+0398 U+03A1 U+03A9 U+03B1 U+03B8 U+03B9 U+03C9 U+0414 U+0420 U+0434 U+0627 U+0628 U+062A U+0646 U+0647 U+0654 U+08A1 U+0915 U+0921 U+0928 U+092F U+093F U+0942 U+094B U+1100 U+1161 U+1780 U+178A U+178F U+17D2 U+1E9E U+1F23 U+1F7C U+1F93 U+1F9B U+1FB6 U+1FB7 U+1FF2 U+200B U+200C U+200D U+2014 U+2019 U+2044 U+2079 U+2089 U+208A U+20AC U+210C U+210D U+2126 U+212B U+215F U+2189 U+21D2 U+2260 U+2460 U+2469 U+2474 U+2488 U+24B6 U+25CC U+2EF3 U+3002 U+30A2 U+30AB U+30C8 U+30D1 U+30E6 U+30F3 U+30FC U+3250 U+329E U+3300 U+3350 U+3389 U+3392 U+5370 U+9F9F U+AC00 U+1F1F2 U+1F1FF U+1F3F4 U+1F3FB U+1F3FC U+1F3FD U+1F3FE U+1F3FF U+1F467 U+1F468 U+1F469 U+1F46A U+E0062 U+E0063 U+E0067 U+E0073 U+E0074 U+E007F U+FE37 U+FEE9 U+FEEA U+FEEB U+FEEC U+FF21 U+FF5B U+FF76
-->
<title>Character Model for the World Wide Web: String Matching</title>
<link rel="canonical" href="http://www.w3.org/TR/2015/WD-charmod-norm-20151119/">
<!-- local styles. Includes the styles from http://www.w3.org/International/docs/styleguide -->
<link rel="stylesheet" href="local.css" type="text/css">
<style id="respec-mainstyle">/*****************************************************************
* ReSpec 3 CSS
* Robin Berjon - http://berjon.com/
*****************************************************************/
/* Override code highlighter background */
.hljs {
background: transparent !important;
}
/* --- INLINES --- */
h1 abbr,
h2 abbr,
h3 abbr,
h4 abbr,
h5 abbr,
h6 abbr,
a abbr {
border: none;
}
dfn {
font-weight: bold;
}
a.internalDFN {
color: inherit;
border-bottom: 1px solid #99c;
text-decoration: none;
}
a.externalDFN {
color: inherit;
border-bottom: 1px dotted #ccc;
text-decoration: none;
}
a.bibref {
text-decoration: none;
}
#references :target {
background: #eaf3ff;
}
cite .bibref {
font-style: normal;
}
code {
color: #c83500;
}
th code {
color: inherit;
}
/* --- TOC --- */
.toc a,
.tof a {
text-decoration: none;
}
a .secno,
a .figno {
color: #000;
}
ul.tof,
ol.tof {
list-style: none outside none;
}
.caption {
margin-top: 0.5em;
font-style: italic;
}
/* --- TABLE --- */
table.simple {
border-spacing: 0;
border-collapse: collapse;
border-bottom: 3px solid #005a9c;
}
.simple th {
background: #005a9c;
color: #fff;
padding: 3px 5px;
text-align: left;
}
.simple th[scope="row"] {
background: inherit;
color: inherit;
border-top: 1px solid #ddd;
}
.simple td {
padding: 3px 10px;
border-top: 1px solid #ddd;
}
.simple tr:nth-child(even) {
background: #f0f6ff;
}
/* --- DL --- */
.section dd>p:first-child {
margin-top: 0;
}
.section dd>p:last-child {
margin-bottom: 0;
}
.section dd {
margin-bottom: 1em;
}
.section dl.attrs dd,
.section dl.eldef dd {
margin-bottom: 0;
}
#issue-summary>ul,
.respec-dfn-list {
column-count: 2;
}
#issue-summary li,
.respec-dfn-list li {
list-style: none;
}
details.respec-tests-details {
margin-left: 1em;
display: inline-block;
vertical-align: top;
}
details.respec-tests-details>* {
padding-right: 2em;
}
details.respec-tests-details[open] {
z-index: 999999;
position: absolute;
border: thin solid #cad3e2;
border-radius: 0.3em;
background-color: white;
padding-bottom: 0.5em;
}
details.respec-tests-details[open]>summary {
border-bottom: thin solid #cad3e2;
padding-left: 1em;
margin-bottom: 1em;
line-height: 2em;
}
details.respec-tests-details>ul {
width: 100%;
margin-top: -0.3em;
}
details.respec-tests-details>li {
padding-left: 1em;
}
a[href].self-link:hover {
opacity: 1;
text-decoration: none;
background-color: transparent;
}
h2,
h3,
h4,
h5,
h6 {
position: relative;
}
aside.example .marker > a.self-link {
color: inherit;
}
h2>a.self-link,
h3>a.self-link,
h4>a.self-link,
h5>a.self-link,
h6>a.self-link {
border: none;
color: inherit;
font-size: 83%;
height: 2em;
left: -1.6em;
opacity: .5;
position: absolute;
text-align: center;
text-decoration: none;
top: 0;
transition: opacity .2s;
width: 2em;
}
h2>a.self-link::before,
h3>a.self-link::before,
h4>a.self-link::before,
h5>a.self-link::before,
h6>a.self-link::before {
content: "§";
display: block;
}
@media (max-width: 767px) {
dd {
margin-left: 0;
}
/* Don't position self-link in headings off-screen */
h2>a.self-link,
h3>a.self-link,
h4>a.self-link,
h5>a.self-link,
h6>a.self-link {
left: auto;
top: auto;
}
}
@media print {
.removeOnSave {
display: none;
}
}
</style><style>/*
github.com style (c) Vasily Polovnyov <[email protected]>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
}
.hljs-comment,
.hljs-quote {
color: #998;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}
.hljs-string,
.hljs-doctag {
color: #d14;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-subst {
font-weight: normal;
}
.hljs-type,
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-regexp,
.hljs-link {
color: #009926;
}
.hljs-symbol,
.hljs-bullet {
color: #990073;
}
.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}
.hljs-meta {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd;
}
.hljs-addition {
background: #dfd;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/W3C-WG-NOTE.css"><link rel="canonical" href="https://www.w3.org/TR/charmod-norm/"><script id="initialUserConfig" type="application/json">{
"specStatus": "WG-NOTE",
"publishDate": "2019-01-30",
"previousPublishDate": "2018-04-20",
"previousMaturity": "WD",
"noRecTrack": true,
"shortName": "charmod-norm",
"copyrightStart": "2004",
"edDraftURI": "https://w3c.github.io/charmod-norm/",
"editors": [
{
"name": "Addison Phillips",
"company": "Amazon.com",
"w3cid": 33573
}
],
"wg": "Internationalization Working Group",
"wgURI": "https://www.w3.org/International/core/",
"wgPublicList": "www-international",
"bugTracker": {
"new": "https://github.com/w3c/charmod-norm/issues",
"open": "https://github.com/w3c/charmod-norm/issues"
},
"otherLinks": [
{
"key": "Github",
"data": [
{
"value": "repository",
"href": "https://github.com/w3c/charmod-norm/"
}
]
}
],
"wgPatentURI": "https://www.w3.org/2004/01/pp-impl/32113/status",
"localBiblio": {
"UTS18": {
"title": "Unicode Technical Standard #18: Unicode Regular Expressions",
"href": "https://unicode.org/reports/tr18/",
"authors": [
"Mark Davis",
"Andy Heninger"
],
"id": "uts18"
},
"Encoding": {
"title": "Encoding",
"href": "https://www.w3.org/TR/encoding/",
"authors": [
"Anne van Kesteren",
"Joshua Bell",
"Addison Phillips"
],
"id": "encoding"
},
"ISO10646": {
"title": "Information Technology - Universal Multiple- Octet Coded CharacterSet (UCS) - Part 1: Architecture and Basic Multilingual Plane",
"authors": [
"ISO/IEC10646-1:1993"
],
"note": "The current specification also takes into consideration the first five amendments to ISO/IEC 10646-1:1993. Useful roadmaps (http://www.egt.ie/standards/iso10646/ucs-roadmap.html) show which scripts sit at which numeric ranges.",
"id": "iso10646"
},
"UTS10": {
"title": "Unicode Technical Standard #10: Unicode Collation Algorithm",
"href": "https://www.unicode.org/reports/tr10/",
"authors": [
"Mark Davis",
"Ken Whistler",
"Markus Scherer"
]
},
"UAX9": {
"title": "Unicode Standard Annex #9: Unicode Bidirectional Algorithm",
"href": "https://unicode.org/reports/tr9/",
"authors": [
"Mark Davis",
"Aharon Lahnin",
"Andrew Glass"
],
"id": "uax9"
},
"UAX11": {
"title": "Unicode Standard Annex #11: East Asian Width",
"href": "https://www.unicode.org/reports/tr11/",
"authors": [
"Ken Lunde 小林劍"
],
"id": "uax11"
},
"UAX29": {
"title": "Unicode Standard Annex #29: Unicode Text Segmentation",
"href": "https://www.unicode.org/reports/tr29/",
"authors": [
"Mark Davis"
],
"id": "uax29"
},
"UTS39": {
"title": "Unicode Technical Standard #39: Unicode Security Mechanisms",
"href": "https://www.unicode.org/reports/tr39/",
"authors": [
"Mark Davis",
"Michel Suignard"
],
"id": "uts39"
},
"UTR36": {
"title": "Unicode Technical Report #36: Unicode Security Considerations",
"href": "https://www.unicode.org/reports/tr36/",
"authors": [
"Mark Davis",
"Michel Suignard"
],
"id": "utr36"
},
"UTR50": {
"title": "Unicode Technical Report #50: Unicode Vertical Text Layout",
"href": "https://www.unicode.org/reports/tr50/",
"authors": [
"Koji Ishii 石井宏治"
],
"id": "utr50"
},
"UTR51": {
"title": "Unicode Technical Report #51: Unicode Emoji",
"href": "https://www.unicode.org/reports/tr51/",
"authors": [
"Mark Davis",
"Peter Edberg"
],
"id": "utr51"
},
"STRING-SEARCH": {
"title": "Character Model for the World Wide Web: String Searching",
"href": "https://w3c.github.io/string-search/",
"authors": [
"Addison Phillips"
],
"id": "string-search"
},
"ASCII": {
"title": "ISO/IEC 646:1991, Information technology -- ISO 7-bit coded character set for information interchange",
"href": "http://www.ecma-international.org/publications/standards/Ecma-006.htm",
"isoNumber": "ISO/IEC 646:1991",
"note": "This standard defines an International Reference Version (IRV) which corresponds exactly to what is widely known as ASCII or US-ASCII. ISO/IEC 646 was based on the earlier standard ECMA-6. ECMA has maintained its standard up to date with respect to ISO/IEC 646 and makes an electronic copy available at http://www.ecma-international.org/publications/standards/Ecma-006.htm ",
"id": "ascii"
}
},
"publishISODate": "2019-01-30T00:00:00.000Z",
"generatedSubtitle": "Working Group Note 30 January 2019"
}</script><meta name="description" content="This document builds upon on Character Model for the World Wide
Web 1.0: Fundamentals [CHARMOD] to provide authors of
specifications, software developers, and content developers a common
reference on string identity matching on the World Wide Web and thereby
increase interoperability."></head>
<body class="h-entry"><div class="head">
<a href="https://www.w3.org/" class="logo"><img alt="W3C" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72" height="48"></a> <h1 id="title" class="title p-name">Character Model for the World Wide Web: String Matching</h1>
<h2>
<abbr title="World Wide Web Consortium">W3C</abbr> Working Group Note
<time class="dt-published" datetime="2019-01-30">30 January 2019</time>
</h2>
<dl>
<dt>This version:</dt><dd>
<a class="u-url" href="https://www.w3.org/TR/2019/NOTE-charmod-norm-20190130/">https://www.w3.org/TR/2019/NOTE-charmod-norm-20190130/</a>
</dd><dt>Latest published version:</dt><dd>
<a href="https://www.w3.org/TR/charmod-norm/">https://www.w3.org/TR/charmod-norm/</a>
</dd>
<dt>Latest editor's draft:</dt><dd><a href="https://w3c.github.io/charmod-norm/">https://w3c.github.io/charmod-norm/</a></dd>
<dt>Bug tracker:</dt><dd><a href="https://github.com/w3c/charmod-norm/issues">File a bug</a> (<a href="https://github.com/w3c/charmod-norm/issues">open bugs</a>)</dd>
<dt>Previous version:</dt><dd><a href="https://www.w3.org/TR/2018/WD-charmod-norm-20180420/">https://www.w3.org/TR/2018/WD-charmod-norm-20180420/</a></dd>
<dt>Editor:</dt>
<dd class="p-author h-card vcard" data-editor-id="33573"><span class="p-name fn">Addison Phillips</span>
(Amazon.com)
</dd>
<dt>Github:</dt><dd>
<a href="https://github.com/w3c/charmod-norm/">repository</a>
</dd>
</dl>
<p class="copyright">
<a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
©
2004-2019
<a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
<a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>,
<a href="http://ev.buaa.edu.cn/">Beihang</a>).
<abbr title="World Wide Web Consortium">W3C</abbr> <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a rel="license" href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules
apply.
</p>
<hr title="Separator for header">
</div>
<section id="abstract" class="introductory"><h2>Abstract</h2>
<p>This document builds upon on <cite>Character Model for the World Wide
Web 1.0: Fundamentals </cite>[<cite><a class="bibref" href="#bib-charmod">CHARMOD</a></cite>] to provide authors of
specifications, software developers, and content developers a common
reference on string identity matching on the World Wide Web and thereby
increase interoperability. </p>
</section>
<section id="sotd" class="introductory"><h2>Status of This Document</h2><p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision of this technical report can be found in the <a href="https://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at https://www.w3.org/TR/.</em></p>
<div class="note" id="issue-container-generatedID"><div role="heading" class="note-title marker" id="h-note" aria-level="3"><span>Note</span></div><div class="">
<p>This version of the document represents a significant change from the
<a href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">earlier
editions</a>. Much of the content is changed and the recommendations
are significantly altered. This fact is reflected in a change to the
name of the document from "Character Model: Normalization".</p>
</div></div>
<div class="note" id="issue-container-generatedID-0"><div role="heading" class="note-title marker" id="h-note-0" aria-level="3"><span>Note</span></div><div class="">
<p data-lang="en" style="font-weight: bold; font-size: 120%">Sending
comments on this document</p>
<p data-lang="en">If you wish to make comments regarding this document,
please raise them as <a href="https://github.com/w3c/charmod-norm/issues" style="font-size: 120%;">github issues</a>. When reviewing the document,
please refer to the latest <a href="https://w3c.github.io/charmod-norm/">editor's
copy</a>. Only send comments by email if you are unable to raise issues on github (see
links below). All comments are welcome.</p>
<p data-lang="en">To make it easier to track comments, please raise
separate issues or emails for each comment, and point to the section
you are commenting on using a URL.</p>
</div></div>
<p>
This document was published by the <a href="https://www.w3.org/International/core/">Internationalization Working Group</a> as
a Working Group Note.
</p><p>
Comments regarding this document are welcome.
Please send them to
<a href="mailto:[email protected]">[email protected]</a>
(<a href="https://lists.w3.org/Archives/Public/www-international/">archives</a>).
</p><p>
Publication as a Working Group Note
does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
This is a draft document and may be updated,
replaced or obsoleted by other documents at any
time. It is inappropriate to cite this document as
other than work in progress.
</p><p data-deliverer="32113">
This document was produced by
a group
operating under the
<a href="https://www.w3.org/Consortium/Patent-Policy/"><abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
<abbr title="World Wide Web Consortium">W3C</abbr> maintains a
<a rel="disclosure" href="https://www.w3.org/2004/01/pp-impl/32113/status">public list of any patent
disclosures</a>
made in connection with the deliverables of
the group; that page also includes
instructions for disclosing a patent. An
individual who has actual knowledge of a patent
which the individual believes contains
<a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a>
must disclose the information in accordance with
<a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
</p><p>
This document is governed by the
<a id="w3c_process_revision" href="https://www.w3.org/2018/Process-20180201/">1 February 2018 <abbr title="World Wide Web Consortium">W3C</abbr> Process Document</a>.
</p></section><nav id="toc"><h2 class="introductory" id="table-of-contents">Table of Contents</h2><ol class="toc"><li class="tocline"><a class="tocxref" href="#intro"><span class="secno">1. </span>Introduction</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#goals"><span class="secno">1.1 </span>Goals and Scope</a></li><li class="tocline"><a class="tocxref" href="#structure"><span class="secno">1.2 </span>Structure of this Document</a></li><li class="tocline"><a class="tocxref" href="#background"><span class="secno">1.3 </span>Background</a></li><li class="tocline"><a class="tocxref" href="#terminology"><span class="secno">1.4 </span>Terminology and Notation</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#terminology-examples"><span class="secno">1.4.1 </span>Terminology Examples</a></li></ol></li><li class="tocline"><a class="tocxref" href="#conformance"><span class="secno">1.5 </span>Conformance</a></li></ol></li><li class="tocline"><a class="tocxref" href="#problemStatement"><span class="secno">2. </span>The String Matching Problem</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#definitionCaseFolding"><span class="secno">2.1 </span>Case Mapping and Case Folding</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#caseMappingLanguageSensitivity"><span class="secno">2.1.1 </span>Language Sensitivity</a></li><li class="tocline"><a class="tocxref" href="#caseFoldApplication"><span class="secno">2.1.2 </span>Uses for Case Folding</a></li></ol></li><li class="tocline"><a class="tocxref" href="#unicodeNormalization"><span class="secno">2.2 </span>Unicode Normalization</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#canonical_compatibility"><span class="secno">2.2.1 </span>Canonical vs. Compatibility Equivalence</a></li><li class="tocline"><a class="tocxref" href="#composition_decomposition"><span class="secno">2.2.2 </span>Composition vs. Decomposition</a></li><li class="tocline"><a class="tocxref" href="#normalization_forms"><span class="secno">2.2.3 </span>Unicode Normalization Forms</a></li></ol></li><li class="tocline"><a class="tocxref" href="#normalizationLimitations"><span class="secno">2.3 </span>Identical-Appearing Characters and the Limitations of Normalization</a></li><li class="tocline"><a class="tocxref" href="#normalizationAndCasefold"><span class="secno">2.4 </span>Interaction of Normalization and Case Folding</a></li><li class="tocline"><a class="tocxref" href="#characterEscapes"><span class="secno">2.5 </span>Character Escapes and Includes</a></li><li class="tocline"><a class="tocxref" href="#invisibleCharacters"><span class="secno">2.6 </span>Invisible Unicode Characters</a></li><li class="tocline"><a class="tocxref" href="#emojiSequences"><span class="secno">2.7 </span>Emoji Sequences</a></li><li class="tocline"><a class="tocxref" href="#legacyCharacterEncoding"><span class="secno">2.8 </span>Legacy Character Encodings</a></li><li class="tocline"><a class="tocxref" href="#otherEquivalences"><span class="secno">2.9 </span>Other Types of Equivalence</a></li></ol></li><li class="tocline"><a class="tocxref" href="#identityMatching"><span class="secno">3. </span>String Matching of Syntactic Content in Document Formats and Protocols</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#choosingMatchingAlgorithm"><span class="secno">3.1 </span>Choosing a Matching Algorithm</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#matchingAlgorithm"><span class="secno">3.1.1 </span>The Matching Algorithm</a></li><li class="tocline"><a class="tocxref" href="#performNorm"><span class="secno">3.1.2 </span>Performing the Appropriate Normalization Step</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#DefaultNormalizationStep"><span class="secno">3.1.2.1 </span>Default Normalization Step</a></li><li class="tocline"><a class="tocxref" href="#ASCIIFoldNormalizationStep"><span class="secno">3.1.2.2 </span>ASCII Case Fold Normalization Step</a></li><li class="tocline"><a class="tocxref" href="#CanonicalFoldNormalizationStep"><span class="secno">3.1.2.3 </span>Unicode Canonical Case Fold Normalization Step</a></li><li class="tocline"><a class="tocxref" href="#CompatibilityFoldNormalizationStep"><span class="secno">3.1.2.4 </span>Unicode Compatibility Case Fold Normalization Step</a></li></ol></li><li class="tocline"><a class="tocxref" href="#convertingToCommonUnicodeForm"><span class="secno">3.1.3 </span>Converting to a Sequence of Unicode Code Points</a></li><li class="tocline"><a class="tocxref" href="#expandingCharacterEscapes"><span class="secno">3.1.4 </span>Expanding Character Escapes and Includes</a></li><li class="tocline"><a class="tocxref" href="#normalizationChoice"><span class="secno">3.1.5 </span>Additional Considerations for Normalization</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#normalizing-spec"><span class="secno">3.1.5.1 </span>Requirements When Specifying Normalization in Document Formats</a></li></ol></li><li class="tocline"><a class="tocxref" href="#handlingCaseFolding"><span class="secno">3.1.6 </span>Additional Considerations for Case Folding</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#sec_case_sensitive"><span class="secno">3.1.6.1 </span>Case-sensitive matching</a></li><li class="tocline"><a class="tocxref" href="#sec_unicode_cs"><span class="secno">3.1.6.2 </span>Unicode case-insensitive matching</a></li><li class="tocline"><a class="tocxref" href="#sec_ascii_cs"><span class="secno">3.1.6.3 </span>ASCII case-insensitive matching</a></li><li class="tocline"><a class="tocxref" href="#sec_language_tailoring"><span class="secno">3.1.6.4 </span>Language-specific tailoring</a></li></ol></li><li class="tocline"><a class="tocxref" href="#additionalMatchTailoring"><span class="secno">3.1.7 </span>Additional Match Tailoring</a></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#otherProcessing"><span class="secno">4. </span>Other Matching and Processing Considerations</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#regularExpressions"><span class="secno">4.1 </span>Regular Expressions</a></li></ol></li><li class="tocline"><a class="tocxref" href="#changes-since-the-last-published-version"><span class="secno">A. </span>Changes Since the Last Published Version</a></li><li class="tocline"><a class="tocxref" href="#acknowledgements"><span class="secno">B. </span>Acknowledgements</a></li><li class="tocline"><a class="tocxref" href="#references"><span class="secno">C. </span>References</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#normative-references"><span class="secno">C.1 </span>Normative references</a></li><li class="tocline"><a class="tocxref" href="#informative-references"><span class="secno">C.2 </span>Informative references</a></li></ol></li></ol></nav>
<section id="intro">
<!--OddPage--><h2 id="x1-introduction"><span class="secno">1. </span>Introduction<a class="self-link" aria-label="§" href="#intro"></a></h2>
<section id="goals">
<h3 id="x1-1-goals-and-scope"><span class="secno">1.1 </span>Goals and Scope<a class="self-link" aria-label="§" href="#goals"></a></h3>
<p>The goal of the Character Model for the World Wide Web is to facilitate use of the Web by all people, regardless of their language, script, writing system, or cultural conventions, in accordance with the <a href="http://www.w3.org/Consortium/mission"><cite><abbr title="World Wide Web Consortium">W3C</abbr> goal of universal access</cite></a>. One basic prerequisite to achieve this goal is to be able to transmit and process the characters used around the world in a well-defined and well-understood way.</p>
<div class="note" id="issue-container-generatedID-1"><div role="heading" class="note-title marker" id="h-note-1" aria-level="4"><span>Note</span></div><p class="">This document builds on <cite>Character Model for the World Wide Web: Fundamentals</cite> [<cite><a class="bibref" href="#bib-charmod">CHARMOD</a></cite>]. Understanding the concepts in that document are important to being able to understand nd apply this document successfully.</p></div>
<p>This part of the Character Model for the World Wide Web covers string
matching—the process by which a specification or implementation defines
whether two string values are the same or different from one another. It
describes the ways in which texts that are semantically equivalent can
be encoded differently and the impact this has on matching operations
important to formal languages (such as those used in the formats and
protocols that make up the Web).</p>
<p>The main target audience of this specification is <abbr title="World Wide Web Consortium">W3C</abbr> specification
developers. This specification and parts of it can be referenced from
other <abbr title="World Wide Web Consortium">W3C</abbr> specifications and it defines conformance criteria for <abbr title="World Wide Web Consortium">W3C</abbr>
specifications, as well as other specifications.</p>
<p>Other audiences of this specification include software developers,
content developers, and authors of specifications outside the <abbr title="World Wide Web Consortium">W3C</abbr>.
Software developers and content developers implement and use <abbr title="World Wide Web Consortium">W3C</abbr>
specifications. This specification defines some conformance criteria
for implementations (software) and content that implement and use <abbr title="World Wide Web Consortium">W3C</abbr>
specifications. It also helps software developers and content
developers to understand the character-related provisions in <abbr title="World Wide Web Consortium">W3C</abbr>
specifications.</p>
<p>The character model described in this specification provides authors
of specifications, software developers, and content developers with a
common reference for consistent, interoperable text manipulation on
the World Wide Web. Working together, these three groups can build a
globally accessible Web.</p>
</section>
<section id="structure">
<h3 id="x1-2-structure-of-this-document"><span class="secno">1.2 </span>Structure of this Document<a class="self-link" aria-label="§" href="#structure"></a></h3>
<p>This document defines one of the basic building blocks for the Web related
to this problem by defining rules and processes for String
Identity Matching in document formats. These rules are designed for
the identifiers and structural markup (<a href="#def_syntactic_content" class="termref">syntactic content</a>)
used in document formats to ensure consistent processing of each and are
targeted to Specification writers. This
section is targeted to implementers.</p>
<p>This document is divided into two main sections.</p>
<p>The <a href="#problemStatement">first section</a> lays out the
problems involved in string matching; the effects of Unicode and case
folding on these problems; and outlines the various issues and
normalization mechanisms that might be used to address these issues.</p>
<p>The <a href="#identityMatching">second section</a> provides
requirements and recommendations for string identity matching for use
in <span class="qterm">formal languages</span>, such as many of the
document formats defined in <abbr title="World Wide Web Consortium">W3C</abbr> Specifications. This primarily is
concerned with making the Web functional and providing document
authors with consistent results. </p>
</section>
<section id="background">
<h3 id="x1-3-background"><span class="secno">1.3 </span>Background<a class="self-link" aria-label="§" href="#background"></a></h3>
<p>This section provides some historical background on the topics
addressed in this specification.</p>
<p>At the core of the character model is the Universal Character Set
(UCS), defined jointly by the <cite>Unicode Standard</cite>
[<cite><a class="bibref" href="#bib-unicode">Unicode</a></cite>] and ISO/IEC 10646 [<cite><a class="bibref" href="#bib-iso10646">ISO10646</a></cite>]. In this document, <dfn data-dfn-type="dfn" id="dfn-unicode">Unicode</dfn>
is used as a synonym for the Universal Character Set. A successful
character model allows Web documents authored in the world's writing
systems, scripts, and languages (and on different platforms) to be
exchanged, read, and searched by the Web's users around the world.</p>
<p>The first few chapters of the <cite>Unicode Standard</cite>
[<cite><a class="bibref" href="#bib-unicode">Unicode</a></cite>] provide useful background reading.</p>
<p>For information about the requirements that informed the development
of important parts of this specification, see <cite>Requirements for
String Identity Matching and String Indexing</cite> [<cite><a class="bibref" href="#bib-charreq">CHARREQ</a></cite>].</p>
</section>
<section id="terminology">
<h3 id="x1-4-terminology-and-notation"><span class="secno">1.4 </span>Terminology and Notation<a class="self-link" aria-label="§" href="#terminology"></a></h3>
<p>This section contains terminology and notation specific to this document.</p>
<p>The Web is built on text-based formats and protocols. In order to
describe string matching or searching effectively, it is necessary to
establish terminology that allows us to talk about the different kinds
of text within a given format or protocol, as the requirements and
details vary significantly. </p>
<p>A <dfn data-lt="unicode code point|unicode code points|code point|code points" data-dfn-type="dfn" id="dfn-unicode-code-point">Unicode code point</dfn> (or "code point") refers to the numeric value assigned to each Unicode character. Unicode code points range from 0 to 0x10FFFF<sub>16</sub>. (See Section 4.1 in [<cite><a class="bibref" href="#bib-charmod">CHARMOD</a></cite>] for a deeper discussion of character encoding terminology.)</p>
<p>Unicode code points are denoted as <code class="kw" translate="no">U+<em>hhhh</em></code>, where <code class="kw" translate="no"><em>hhhh</em></code> is a sequence of at least four, and at most six hexadecimal digits. For example, the character <span class="codepoint"><span lang="en">€</span> [<span class="uname">U+20AC EURO SIGN</span>]</span> has the code point <span class="uname" translate="no">U+20AC</span>.</p>
<p>Some characters used in this document's examples might not appear as intended on your specific device or display. Usually this is due to lack of a script-specific font installed locally or due to other limitations of your specific rendering system. This document uses a Webfont to provide fallback glyphs for many of the non-Latin characters, but your device might not support displaying the font. To the degree possible, the editors have tried to ensure that the examples nevertheless remain understandable.</p>
<p>A <dfn data-lt="legacy character encoding|legacy character encodings" data-dfn-type="dfn" id="dfn-legacy-character-encoding">legacy character encoding</dfn> is a character encoding form that does not encode the full repertoire of characters in the Unicode character set.</p>
<p>A <dfn data-lt="transcoder|transcoders" data-dfn-type="dfn" id="dfn-transcoder">transcoder</dfn> is a process that converts
text between two character encodings. Most commonly in this document it
refers to a process that converts from a <a href="#dfn-legacy-character-encoding" class="internalDFN" data-link-type="dfn">legacy character encoding</a>
to a <a href="http://www.w3.org/TR/2005/REC-charmod-20050215/#Unicode_Encoding_Form">Unicode encoding form</a>,
such as UTF-8.</p>
<p><dfn id="def_syntactic_content" data-dfn-type="dfn">Syntactic content</dfn> is any text in a document format or protocol that belongs to the structure of the format or protocol. This definition includes values that are typically thought of as "markup" but can also include other values, such as the name of a field in an HTTP header. Syntactic content consists of all of the characters that form the <em>structure</em> of a format or protocol. For example, <span class="qchar"><</span> and <span class="qchar">></span> (as well as the element name and various attributes they surround) are part of the syntactic content in an HTML document.</p>
<p>Syntactic content usually is defined by a specification or specifications and
includes both the defined, reserved keywords for the given protocol or
format as well as string tokens and identifiers that are defined by
document authors to form the structure of the document (rather than
the "content" of the document).</p>
<aside class="example" id="ex-1-example-1-xml-xml10-defines-specific-elements-attributes-and-values-that-are-reserved-across-all-xml-documents-thus-the-word-encoding-has-a-defined-meaning-inside-the-xml-document-declaration-it-is-a-reserved-name-xml-also-allows-a-user-to-define-elements-and-attributes-for-a-given-document-for-example-by-using-a-dtd-in-a-document-that-uses-a-dtd-that-defines-an-element-called-muffin-muffin-is-a-part-of-the-syntactic-content"><div class="marker"><a class="self-link" href="#ex-1-example-1-xml-xml10-defines-specific-elements-attributes-and-values-that-are-reserved-across-all-xml-documents-thus-the-word-encoding-has-a-defined-meaning-inside-the-xml-document-declaration-it-is-a-reserved-name-xml-also-allows-a-user-to-define-elements-and-attributes-for-a-given-document-for-example-by-using-a-dtd-in-a-document-that-uses-a-dtd-that-defines-an-element-called-muffin-muffin-is-a-part-of-the-syntactic-content">Example 1</a></div>
<p><cite>XML</cite> [<cite><a class="bibref" href="#bib-xml10">XML10</a></cite>] defines specific elements, attributes,
and values that are reserved across all XML documents. Thus, the
word <code class="kw" translate="no">encoding</code> has a defined
meaning inside the XML document declaration: it is a reserved name.
XML also allows a user to define elements and attributes for a given
document, for example, by using a DTD. In a document that uses a DTD that defines an
element called <code class="kw"><muffin></code>, <span class="qterm">muffin</span>
is a part of the syntactic content.</p>
</aside>
<p><dfn data-dfn-type="dfn" id="dfn-natural-language-content">Natural language content</dfn> refers to the language-bearing
content in a document and <b>not</b> to any of the surrounding or embedded
syntactic content that form part of the document structure. You can think
of it as the actual "content" of the document or the "message" in a
given protocol. Note that syntactic content can contain natural
language content, such as when an [<cite><a class="bibref" href="#bib-html">HTML</a></cite>] <code class="kw">img</code> element
has an <code class="kw">alt</code> attribute containing a description of
the image.</p>
<p>A <dfn data-lt="resource|resources" data-dfn-type="dfn" id="dfn-resource">resource</dfn>, in the context of this document, is a given
document, file, or protocol "message" which includes both the <a href="#dfn-natural-language-content" class="internalDFN" data-link-type="dfn">natural
language content</a> as well as the <a href="#def_syntactic_content" class="termref">syntactic content</a>
such as identifiers surrounding or containing it. For example, in an
HTML document that also has some CSS and a few <code class="kw" translate="no">script</code>
tags with embedded JavaScript, the entire HTML document, considered as
a file, is a resource. This term is intentionally similar to the term
'resource' as used in [<cite><a class="bibref" href="#bib-rfc3986">RFC3986</a></cite>], although here the term is applied
loosely. </p>
<p>A <dfn data-lt="user-supplied value|user-supplied values" data-dfn-type="dfn" id="dfn-user-supplied-value">user-supplied value</dfn> is unreserved syntactic content in a <a href="#def_vocabulary" class="internalDFN" data-link-type="dfn">vocabulary</a> that is assigned by users, as distinct from reserved keywords in a given format or protocol. For example, CSS class names are part of the syntax of a CSS style sheet. They are not reserved keywords, predefined by any CSS specification, but they are still are subject to the syntactic rules of CSS. Users generally expect that keywords they define can be representative of words or concepts in their given natural language, subject to the limitations of those rules.</p>
<p>A <dfn id="def_vocabulary" data-dfn-type="dfn">vocabulary</dfn> provides the list of
reserved names as well as the set of rules and specifications
controlling how <a href="#dfn-user-supplied-value" class="internalDFN" data-link-type="dfn">user-supplied values</a> (such as identifiers) can be assigned in a
format or protocol. This can include restrictions on range, order, or
type of characters that can appear in different places. For example,
HTML defines the names of its elements and attributes, as well as
enumerated attribute values, which defines the "vocabulary" of HTML
<a href="#def_syntactic_content" class="termref">syntactic content</a>.
Another example would be ECMAScript, which restricts the range of
characters that can appear at the start or in the body of an identifier
or variable name. It applies different rules for other cases, such as to
the values of string literals.</p>
<p>A <dfn data-lt="grapheme|graphemes" data-dfn-type="dfn" id="dfn-grapheme">grapheme</dfn> is a sequence of
one or more characters in a visual representation of some text
that a typical user would perceive as being a single unit (<q>character</q>).
Graphemes are important for a number of text operations such as
sorting or text selection, so it is necessary to be able to compute
the boundaries between each user-perceived character. Unicode defines
the default mechanism for computing graphemes in <cite>Unicode
Standard Annex #29: Text Segmentation</cite> [<cite><a class="bibref" href="#bib-uax29">UAX29</a></cite>] and calls
this approximation a <dfn data-dfn-type="dfn" id="dfn-grapheme-cluster">grapheme cluster</dfn>. There are two types
of default grapheme cluster defined. Unless otherwise noted, grapheme
cluster in this document refers to an extended default grapheme
cluster. (A discussion of grapheme clusters is also given in Section 2
of the <cite>Unicode Standard</cite>, [<cite><a class="bibref" href="#bib-unicode">Unicode</a></cite>]. Cf. near the end of
<a href="http://www.unicode.org/versions/latest/ch02.pdf">Section 2.11</a>
in version 8.0 of The Unicode Standard)</p>
<p>Because different natural languages have different needs, grapheme clusters
can also sometimes require tailoring. For example, a Slovak user might
wish to treat the default pair of grapheme clusters "ch" as a single
grapheme cluster. Note that the interaction between the language of
string content and the end-user's preferences might be complex.</p>
<aside class="example" id="graphemeExample"><div class="marker"><a class="self-link" href="#graphemeExample">Example 2</a></div>
<p>The Hindi word for Unicode <q>यूनिकोड</q> is composed of seven Unicode characters from the Devanagari script.
</p>
<p>Most users would identify this word as containing four units of text. Each of the first three graphemes consists of two characters: a syllable and a modifying vowel character. So the word contains seven Unicode characters, but only four graphemes:</p>
<table style="width: 70%; margin-left: 15%; margin-right: 15%">
<tbody><tr>
<td style="width: 30%">Word</td>
<td colspan="7" class="bigtext">यूनिकोड</td>
</tr>
<tr>
<td>Graphemes</td>
<td class="bigtext" colspan="2">यू</td>
<td class="bigtext" colspan="2">नि</td>
<td class="bigtext" colspan="2">को</td>
<td class="bigtext">ड</td>
</tr>
<tr>
<td>Code Points</td>
<td class="bigtext">य</td>
<td class="bigtext">ू</td>
<td class="bigtext">न</td>
<td class="bigtext">ि</td>
<td class="bigtext">क</td>
<td class="bigtext">ो</td>
<td class="bigtext">ड</td>
</tr>
<tr>
<td></td>
<td style="text-align:center">U+092F</td>
<td style="text-align:center">U+0942</td>
<td style="text-align:center">U+0928</td>
<td style="text-align:center">U+093F</td>
<td style="text-align:center">U+0915</td>
<td style="text-align:center">U+094B</td>
<td style="text-align:center">U+0921</td>
</tr>
</tbody></table>
</aside>
<section id="terminology-examples">
<h4 id="x1-4-1-terminology-examples"><span class="secno">1.4.1 </span>Terminology Examples<a class="self-link" aria-label="§" href="#terminology-examples"></a></h4>
<p>This section illustrates some of the terminology defined above. For illustration purposes we'll use the following small HTML file as an example (line numbers added for reference):</p>
<div class="terminologyExample">
<p class="syntaxExample"><span class="lnum">1 </span> <span class="markup"><<span class="vocabulary">html</span> <span class="vocabulary">lang</span>="<span class="userValue">en</span>" <span class="vocabulary">dir</span>="<span class="vocabulary">ltr</span>"></span></p>
<p class="syntaxExample"><span class="lnum">2 </span><span class="markup"><<span class="vocabulary">head</span>></span></p>
<p class="syntaxExample"><span class="lnum">3 </span><span class="markup"> <<span class="vocabulary">meta</span> <span class="vocabulary">charset</span>="<span class="userValue">UTF-8</span>"></span></p>
<p class="syntaxExample"><span class="lnum">4 </span><span class="markup"> <<span class="vocabulary">title</span>></span><span class="shakespeare">Shakespeare</span><span class="markup"></<span class="vocabulary">title</span>></span></p>
<p class="syntaxExample"><span class="lnum">5 </span></<span class="vocabulary">head</span>></p>
<p class="syntaxExample"><span class="lnum">6 </span><<span class="vocabulary">body</span>></p>
<p class="syntaxExample"><span class="lnum">7 </span><span class="markup"> <<span class="vocabulary">img</span> <span class="vocabulary">src</span>="<span class="userValue">shakespeare.jpg</span>" <span class="vocabulary">alt</span>="<span class="userValue"><span class="shakespeare">William Shakespeare</span></span>" <span class="vocabulary">id</span>="<span class="userValue">shakespeare_image</span>"></span></p>
<p class="syntaxExample"><span class="lnum">8 </span><span class="markup"> <<span class="vocabulary">p</span>></span><span class="shakespeare">What<span class="markup">&#x2019;</span>s in a name? That which we call a rose by any other name would smell as sweet.</span><span class="markup"></<span class="vocabulary">p</span>></span></p>
<p class="syntaxExample"><span class="lnum">9 </span></<span class="vocabulary">body</span>></p>
<p class="syntaxExample"><span class="lnum">10 </span><span class="markup"></<span class="vocabulary">html</span>></span> </p>
</div>
<ul style="text-align:left">
<li>Everything inside the black rectangle (that is, in this HTML file) is part of the <a href="#dfn-resource" class="internalDFN" data-link-type="dfn">resource</a>.</li>
<li><a href="#def_syntactic_content" class="internalDFN" data-link-type="dfn">Syntactic content</a> in this case includes all of the HTML markup. There are only two strings that are <strong>not</strong> part of the syntactic content: the word <em>"Shakespeare"</em> on line 4 and the sentence <em>"What’s in a name? That which we call a rose by any other name would smell as sweet."</em> on line 8. (The HTML entity <q><kbd>&#x2019;</kbd></q> embedded in the sentence on line 8 <em>is</em> part of the syntactic content.)</li>
<li><a href="#dfn-natural-language-content" class="internalDFN" data-link-type="dfn">Natural language content</a> is shown in a <span class="shakespeare">bold blue font with a gray background</span>. In addition to the non-syntactic content, the <kbd>alt</kbd> value on line 7 (<em><q>William Shakespeare</q></em>) contains natural language text.</li>
<li>User-supplied values are shown in <span class="userValue">italics</span>. In this case there are three user-supplied values on line 7: the values of the <kbd>src</kbd>, <kbd>alt</kbd>, and <kbd>id</kbd> attributes of the <kbd>img</kbd> tag. In addition, the value of the <kbd>lang</kbd> attribute on line 1 and the <kbd>charset</kbd> attribute on line 3 are user-supplied values.</li>
<li><a href="#def_vocabulary" class="internalDFN" data-link-type="dfn">Vocabulary</a> is shown with <span class="vocabulary">red underlining</span>. The vocabulary of an HTML document are the elements and attributes (as well as some of the attribute values, such as the value <kbd>ltr</kbd> for the attribute <kbd>dir</kbd> in the example above) defined in [<cite><a class="bibref" href="#bib-html5">HTML5</a></cite>].</li>
</ul>
<div class="note" id="issue-container-generatedID-2"><div role="heading" class="note-title marker" id="h-note-2" aria-level="5"><span>Note</span></div><p class="">All of the text above (all text in a text file) makes up the resource. It's possible that a given resource will contain no natural language content at all (consider an HTML document consisting of four empty <code>div</code> elements styled to be orange rectangles). It's also possible that a resource will contain <em>no</em> syntactic content and consist solely of natural language content: for example, a plain text file with a soliloquy from <cite>Hamlet</cite> in it. Notice too that the HTML entity <code>&#x2019;</code> appears in the natural language content and belongs to both the natural language content and the syntactic content in this resource.</p></div>
</section>
</section>
<section id="conformance"><h3 id="x1-5-conformance"><span class="secno">1.5 </span>Conformance<a class="self-link" aria-label="§" href="#conformance"></a></h3><p>
As well as sections marked as non-normative, all authoring guidelines,
diagrams, examples, and notes in this specification are non-normative.
Everything else in this specification is normative.
</p><p id="respecRFC2119">The key words <em class="rfc2119">MAY</em>, <em class="rfc2119">MUST</em>, <em class="rfc2119">MUST NOT</em>, <em class="rfc2119">RECOMMENDED</em>, <em class="rfc2119">SHOULD</em>, and <em class="rfc2119">SHOULD NOT</em> are to be interpreted as described in [<cite><a class="bibref" href="#bib-rfc2119">RFC2119</a></cite>].</p>
<p>This document describes best practices for the authors of other specifications, as well as recommendations for implementations and content authors. These best practices can also be found in the Internationalization Working Group's document <cite>Internationalization Best Practices for Spec Developers</cite> [<cite><a class="bibref" href="#bib-international-specs">INTERNATIONAL-SPECS</a></cite>], which is intended to serve as a general reference for all Internationalization best practices in <abbr title="World Wide Web Consortium">W3C</abbr> specifications.</p>
<p class="requirement">When a best practice or recommendation appears in this document, it has been styled like this paragraph. Recommendations for specifications and spec authors are preceded by <span class="qrec">[S]</span>. Recommendations for implementations and software developers are preceeded by <span class="qrec">[I]</span>. Recommendations for content and content authors are preceeded by <span class="qrec">[C]</span>.</p>
<p>Best practices in this document use [<cite><a class="bibref" href="#bib-rfc2119">RFC2119</a></cite>] keywords in order to clarify the Internationalization Working Group's intentions regarding a specific recommendation. Following the recommendations in this document can help avoid issues during the <abbr title="World Wide Web Consortium">W3C</abbr>'s "wide review" process, during implementation, or in the content that authors produce. This document is not, itself, normative and can be revised from time to time.</p>
<p>Specifications can claim conformance to this document if they:</p>
<ol type="1">
<li>do not violate any conformance criteria preceded by <span class="qrec">[S]</span> where the imperative is <em class="rfc2119" title="MUST">MUST</em> or <em class="rfc2119" title="MUST NOT">MUST NOT</em></li>
<li>document the reason for any deviation from criteria where the imperative is <em class="rfc2119" title="SHOULD">SHOULD</em>, <em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em>, or <em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em></li>
<li>make it a conformance requirement for implementations to conform to this document</li>
<li>make it a conformance requirement for content to conform to this document</li>
</ol>
<div class="note" id="issue-container-generatedID-3"><div role="heading" class="note-title marker" id="h-note-3" aria-level="4"><span>Note</span></div><p class="">Requirements placed on specifications might indirectly cause requirements to be placed on implementations or content that claim to conform to those specifications.</p></div>
<p>Where this specification contains a procedural description, it is to be understood as a way to specify the desired external behavior. Implementations <em class="rfc2119" title="MAY">MAY</em> use other means of achieving the same results, as long as observable behavior is not affected.</p>
</section>
</section>
<section id="problemStatement">
<!--OddPage--><h2 id="x2-the-string-matching-problem"><span class="secno">2. </span>The String Matching Problem<a class="self-link" aria-label="§" href="#problemStatement"></a></h2>