diff --git a/index.html b/index.html index c6f74b7..8d807d0 100644 --- a/index.html +++ b/index.html @@ -2009,19 +2009,20 @@
Notwithstanding the note just above, I18N's best practices appear to be exactly opposite those in [[DESIGN-PRINCIPLES]] at the moment. The details turn out to be the same, but we need to resolve differences in guidance and wording. The issue design-principles#454 tracks this.
+Notwithstanding the note just above, I18N's best practices appear to be exactly opposite those in [[DESIGN-PRINCIPLES]] at the moment. The details turn out to be the same, but we need to resolve differences in guidance and wording. The issue design-principles#454 tracks this.
Unless you have a reason not to, use a string definition consistent with {{USVString}}.
+Unless you have a reason not to, use a string definition consistent with {{DOMString}}.
Use a string definition consistent with {{DOMString}} if your specification does not process the internal value of strings and is not required to check for unpaired surrogate code points, or if your specification pertains to the [[DOM]], defines a JavaScript API or data format, or defines strings as opaque values that are not processed.
+Use a {{DOMString}} when defining document formats or the wire format of a protocol, or for any process pertaining to the [[DOM]], or which defines strings as opaque values whose individual character contents are not meant to be evaluated. (This list of uses is not exhaustive.)
+Scalar value string definition in [[INFRA]]
IDL String Types in Web Platform Design Principles [[DESIGN-PRINCIPLES]]
@@ -2029,6 +2030,14 @@The use of {{DOMString}} in document formats and protocols is preferred because it is best to be consistent. Mixing {{DOMString}} and {{USVString}} in a single document or protocol operation requires extra processing for very little benefit or gain.
+Use a {{USVString}} when defining an algorithm that iterates over the code points in a string. Use {{USVString}} for any process which involves UTF-8 encode or for anywhere in which an unpaired surrogate code point would produce an error.
+A string is a sequence of characters. Because [[UNICODE]] is fundamental to understanding and working with text, including text that uses legacy character encodings, the basic definition of a string depends on Unicode and its concept of a encoded character. Specifically:
A string is a well-formed sequence of zero or more Unicode Scalar Values.