summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVictor Berger <vberger@users.noreply.github.com>2017-10-02 19:52:21 +0200
committermujx <mujx@users.noreply.github.com>2017-10-02 20:52:21 +0300
commit73222aa900cbcc081444394ecfd9db3dc114a9a8 (patch)
treecede3f3af740687033a948a7abf6a03d4c2dfcb7 /src
parentBuild lmdb on appveyor (diff)
downloadnheko-73222aa900cbcc081444394ecfd9db3dc114a9a8.tar.xz
Fix unicode handling of replaceEmoji (#84)
Diffstat (limited to 'src')
-rw-r--r--src/TimelineItem.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/TimelineItem.cc b/src/TimelineItem.cc

index 97269584..28cabc12 100644 --- a/src/TimelineItem.cc +++ b/src/TimelineItem.cc
@@ -371,17 +371,17 @@ TimelineItem::replaceEmoji(const QString &body) { QString fmtBody = ""; - for (auto &c : body) { - int code = c.unicode(); + QVector<uint> utf32_string = body.toUcs4(); + for (auto &code : utf32_string) { // TODO: Be more precise here. if (code > 9000) fmtBody += QString("<span style=\"font-family: Emoji " "One; font-size: %1px\">") .arg(conf::emojiSize) + - QString(c) + "</span>"; + QString::fromUcs4(&code, 1) + "</span>"; else - fmtBody += c; + fmtBody += QString::fromUcs4(&code, 1); } return fmtBody;