Skip to content

Commit d05c796

Browse files
committed
qt/tonalutils: Add support for parsing UCSUR Tonal codepoints
1 parent e6a89a9 commit d05c796

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/qt/tonalutils.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bool TonalUtils::Supported()
3838
return false;
3939
}
4040

41-
#define RE_TONAL_DIGIT "[\\d\\xe9d9-\\xe9df]"
41+
#define RE_TONAL_DIGIT "[\\d\\xe8e9-\\xe8ef\\xe9d9-\\xe9df]"
4242
static QRegExpValidator tv(QRegExp("-?(?:" RE_TONAL_DIGIT "+\\.?|" RE_TONAL_DIGIT "*\\." RE_TONAL_DIGIT "*)"), nullptr);
4343

4444
QValidator::State TonalUtils::validate(QString&input, int&pos)
@@ -67,12 +67,16 @@ void TonalUtils::ConvertToHex(QString&str)
6767
for (int i = 0; i < str.size(); ++i)
6868
{
6969
ushort c = str[i].unicode();
70-
if (c == 0xe9d9)
70+
if (c == 0xe9d9 || c == 0xe8e9) {
7171
str[i] = '9';
72+
}
7273
else
7374
if (c == '9')
7475
str[i] = 'a';
7576
else
77+
if (c >= 0xe8ea && c <= 0xe8ef) {
78+
str[i] = c - (0xe8ea - 'a');
79+
} else
7680
if (c >= 0xe9da && c <= 0xe9df)
7781
str[i] = c - 0xe999;
7882
}

0 commit comments

Comments
 (0)