mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 21:51:40 +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:
|
case RI:
|
||||||
if (isRegionalIndicator(ch))
|
if (isRegionalIndicator(ch))
|
||||||
mixin(eat);
|
mixin(eat);
|
||||||
else
|
|
||||||
goto L_End_Extend;
|
goto L_End_Extend;
|
||||||
break;
|
|
||||||
case L:
|
case L:
|
||||||
if (isHangL(ch))
|
if (isHangL(ch))
|
||||||
mixin(eat);
|
mixin(eat);
|
||||||
|
@ -7153,6 +7151,7 @@ if (isInputRange!Input && is(immutable ElementType!Input == immutable dchar))
|
||||||
@safe unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
import std.algorithm.comparison : equal;
|
import std.algorithm.comparison : equal;
|
||||||
|
debug import std.stdio;
|
||||||
|
|
||||||
Grapheme gr;
|
Grapheme gr;
|
||||||
string s = " \u0020\u0308 ";
|
string s = " \u0020\u0308 ";
|
||||||
|
@ -7166,6 +7165,10 @@ if (isInputRange!Input && is(immutable ElementType!Input == immutable dchar))
|
||||||
s = "\u11A8\u0308\uAC01";
|
s = "\u11A8\u0308\uAC01";
|
||||||
assert(equal(decodeGrapheme(s)[], "\u11A8\u0308"));
|
assert(equal(decodeGrapheme(s)[], "\u11A8\u0308"));
|
||||||
assert(equal(decodeGrapheme(s)[], "\uAC01"));
|
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