File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2553,12 +2553,15 @@ void CBaseHudChatEntry::InsertChar(wchar_t ch)
25532553 return ;
25542554 }
25552555
2556+ /* Pasting strings that overflow and end with multibyte+singlebyte will truncate unintuitively ("...ABC?!!" -> "...AB?")
25562557 // Edge case: check if current wchar_t will cause Send to truncate message
25572558 int iCharByteLen; // utf-8
25582559 if ( ch < 0x80 ) iCharByteLen = 1;
25592560 else if ( ch < 0x800 ) iCharByteLen = 2;
25602561 else if ( ch >= 0xD800 && ch <= 0xDBFF ) iCharByteLen = 4; // high surrogate, assume pair
25612562 else if ( ch >= 0xDC00 && ch <= 0xDFFF ) // low surrogate
2563+ */
2564+ if ( ch >= 0xDC00 && ch <= 0xDFFF ) // low surrogate
25622565 {
25632566 // Check if previous wchar was a high surrogate
25642567 wchar_t wszHigh[2 ];
@@ -2567,13 +2570,15 @@ void CBaseHudChatEntry::InsertChar(wchar_t ch)
25672570 if ( wszHigh[0 ] >= 0xD800 && wszHigh[0 ] <= 0xDBFF ) { BaseClass::InsertChar (ch); return ; }
25682571 else return ; // it was not a hight surrogate, reject
25692572 }
2573+ /*
25702574 else iCharByteLen = 3;
25712575
25722576 if ( iCurrentByteLen + iCharByteLen <= m_iMaxByteCount )
25732577 {
25742578 BaseClass::InsertChar(ch);
25752579 return;
25762580 }
2581+ */
25772582
25782583 return ; // do not insert anything
25792584}
You can’t perform that action at this time.
0 commit comments