mirror of
https://github.com/dlang/phobos.git
synced 2025-04-26 21:22:20 +03:00
Fix issue 23250 - corrected reginal indicator pairing.
This commit is contained in:
parent
494b318c0a
commit
95d19d97ac
1 changed files with 6 additions and 3 deletions
|
@ -7032,9 +7032,7 @@ template genericDecodeGrapheme(bool getValue)
|
|||
case RI:
|
||||
if (isRegionalIndicator(ch))
|
||||
mixin(eat);
|
||||
else
|
||||
goto L_End_Extend;
|
||||
break;
|
||||
goto L_End_Extend;
|
||||
case L:
|
||||
if (isHangL(ch))
|
||||
mixin(eat);
|
||||
|
@ -7153,6 +7151,7 @@ if (isInputRange!Input && is(immutable ElementType!Input == immutable dchar))
|
|||
@safe unittest
|
||||
{
|
||||
import std.algorithm.comparison : equal;
|
||||
debug import std.stdio;
|
||||
|
||||
Grapheme gr;
|
||||
string s = " \u0020\u0308 ";
|
||||
|
@ -7166,6 +7165,10 @@ if (isInputRange!Input && is(immutable ElementType!Input == immutable dchar))
|
|||
s = "\u11A8\u0308\uAC01";
|
||||
assert(equal(decodeGrapheme(s)[], "\u11A8\u0308"));
|
||||
assert(equal(decodeGrapheme(s)[], "\uAC01"));
|
||||
|
||||
// Two Union Jacks of the Great Britain
|
||||
s = "\U0001F1EC\U0001F1E7\U0001F1EC\U0001F1E7";
|
||||
assert(equal(decodeGrapheme(s)[], "\U0001F1EC\U0001F1E7"));
|
||||
}
|
||||
|
||||
/++
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue