diff --git a/Telegram/SourceFiles/ui/text/text_entity.cpp b/Telegram/SourceFiles/ui/text/text_entity.cpp index 5c68a9538..98fc1b516 100644 --- a/Telegram/SourceFiles/ui/text/text_entity.cpp +++ b/Telegram/SourceFiles/ui/text/text_entity.cpp @@ -24,6 +24,17 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "lang/lang_tag.h" namespace TextUtilities { + +// note: these names are taken from Unicode Specification. +// All spaces in this names are replaced to SwitchingCase, all dashes ('-') +// are replaced to underscore ('_') +enum UnicodePoints +{ + Left_PointingDoubleAngleQuotationMark = 171, + Right_PointingDoubleAngleQuotationMark = 187, + EmDash = 8212, +}; + namespace { QString ExpressionDomain() { @@ -2121,9 +2132,9 @@ void PrepareForSending(TextWithEntities &result, qint32 flags) { } if (cMessageFormatting()) { - ReplaceStringWithChar(qstr("--"), QChar(8212), result, true); - ReplaceStringWithChar(qstr("<<"), QChar(171), result); - ReplaceStringWithChar(qstr(">>"), QChar(187), result); + ReplaceStringWithChar(qstr("--"), QChar(EmDash), result, true); + ReplaceStringWithChar(qstr("<<"), QChar(Left_PointingDoubleAngleQuotationMark), result); + ReplaceStringWithChar(qstr(">>"), QChar(Right_PointingDoubleAngleQuotationMark), result); } if (cReplaceEmojis()) {