mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-28 06:28:04 +03:00
Host_Say: Fix invalid sequence in UTF-8
This commit is contained in:
parent
9c6c880644
commit
6866339b0c
@ -806,8 +806,16 @@ void Host_Say(edict_t *pEntity, BOOL teamonly)
|
|||||||
p[Q_strlen(p) - 1] = '\0';
|
p[Q_strlen(p) - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if buffer contains an invalid unicode sequence
|
||||||
|
// This can happen after truncation up to 127 chars into SV_ParseStringCommand
|
||||||
|
if (!Q_UnicodeValidate(p))
|
||||||
|
{
|
||||||
|
// Try fix invalid sequence in UTF-8
|
||||||
|
Q_UnicodeRepair(p);
|
||||||
|
}
|
||||||
|
|
||||||
// make sure the text has content
|
// make sure the text has content
|
||||||
if (/*!p || */!p[0] || !Q_UnicodeValidate(p))
|
if (!p[0])
|
||||||
{
|
{
|
||||||
// no character found, so say nothing
|
// no character found, so say nothing
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user