You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[browser] Fix HybridGlobalization, SoftHyphen is not ignored when it should be (dotnet#105946)
* Ignore SoftHyphen.
* Update docs.
* Implementation with `matchLength` should throw with PNSE, not ArgumentException.
* String.Replace uses IndexOf with matchLength, so expect it to throw.
Copy file name to clipboardexpand all lines: docs/design/features/globalization-hybrid-mode.md
+16-3
Original file line number
Diff line number
Diff line change
@@ -270,13 +270,12 @@ Dependencies:
270
270
271
271
Web API does not expose locale-sensitive endsWith/startsWith function. As a workaround, both strings get normalized and weightless characters are removed. Resulting strings are cut to the same length and comparison is performed. This approach, beyond having the same compare option limitations as described under **String comparison**, has additional limitations connected with the workaround used. Because we are normalizing strings to be able to cut them, we cannot calculate the match length on the original strings. Methods that calculate this information throw PlatformNotSupported exception:
Only comparisons that do not skip character types are allowed. E.g. `IgnoreSymbols` skips symbol-chars in comparison/indexing. All `CompareOptions` combinations that include `IgnoreSymbols` throw `PlatformNotSupportedException`.
278
278
279
-
280
279
**String indexing**
281
280
282
281
Affected public APIs:
@@ -287,6 +286,15 @@ Affected public APIs:
287
286
288
287
Web API does not expose locale-sensitive indexing function. There is a discussion on adding it: https://github.com/tc39/ecma402/issues/506. In the current state, as a workaround, locale-sensitive string segmenter combined with locale-sensitive comparison is used. This approach, beyond having the same compare option limitations as described under **String comparison**, has additional limitations connected with the workaround used. Information about additional limitations:
289
288
289
+
- Methods that calculate `matchLength` always return throw PlatformNotSupported exception:
- String.Replace that uses `StringComparison` argument relies internally on IndexOf with `matchLength` argument. From this reason, it throws PlatformNotSupportedException:
- Support depends on [`Intl.segmenter's support`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter#browser_compatibility).
291
299
292
300
-`IgnoreSymbols`
@@ -463,6 +471,11 @@ Affected public APIs:
463
471
- String.IndexOf
464
472
- String.LastIndexOf
465
473
474
+
Methods that calculate `matchLength` throw PlatformNotSupported exception:
Mapped to Apple Native API `rangeOfString:options:range:locale:`(https://developer.apple.com/documentation/foundation/nsstring/1417348-rangeofstring?language=objc)
467
480
468
481
In `rangeOfString:options:range:locale:` objects are compared by checking the Unicode canonical equivalence of their code point sequences.
0 commit comments