forked from qt-creator/qt-creator
Cpp{Tools,Editor}: Respect multi-QChar code points when handling identifiers
* Consolidate code dealing with C++ identifiers into cpptoolsreuse.h * Handle code points that are represented with two QChars Change-Id: I4fb4435aa539f65d88598cac0b50629f33f32440 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -66,8 +66,10 @@ QString cleanText(const QString &original)
|
||||
int ignore = 0;
|
||||
for (int i = clean.length() - 1; i >= 0; --i, ++ignore) {
|
||||
const QChar &c = clean.at(i);
|
||||
if (c.isLetterOrNumber() || c == QLatin1Char('_'))
|
||||
if (c.isLetterOrNumber() || c == QLatin1Char('_')
|
||||
|| c.isHighSurrogate() || c.isLowSurrogate()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ignore)
|
||||
clean.chop(ignore);
|
||||
|
||||
Reference in New Issue
Block a user