mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
886 lines
41 KiB
C++
886 lines
41 KiB
C++
/*
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at
|
|
* your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*
|
|
* In addition, as a special exception, the author gives permission to
|
|
* link the code of this program with the Half-Life Game Engine ("HL
|
|
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
|
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
|
* respects for all of the code used other than the HL Engine and MODs
|
|
* from Valve. If you modify this file, you may extend this exception
|
|
* to your version of the file, but you are not obligated to do so. If
|
|
* you do not wish to do so, delete this exception statement from your
|
|
* version.
|
|
*
|
|
*/
|
|
|
|
#include "precompiled.h"
|
|
|
|
// Table for Q_iswprint
|
|
#pragma region PrintTable_Region
|
|
static const uint32_t g_isPrintTable[2048] =
|
|
{
|
|
0x00000200, 0xFFFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xF9FFFFFF, 0x00030003, 0x0000401F,
|
|
0x00000000, 0x00000000, 0x00000000, 0x7CCF0000, 0xFFFFD7C0, 0xFFFFFFFB, 0xFFFFFFFF, 0xFFBFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFC03, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFE000F, 0xFE7FFFFF, 0xFFFFFFFE, 0x000006FF, 0x40000000, 0xFFFF0049, 0x001F07FF,
|
|
0xC8003600, 0xFFFFFFFE, 0x000007FF, 0xFFFEFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x003FFFFF, 0x9FFFC060,
|
|
0xFFFD3FFF, 0x0000FFFF, 0xFFFFE000, 0xFFFFFFFF, 0xFFFFFFFF, 0x0002003F, 0xFFFFFFFF, 0x07B007FF,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0xFFFFFFF0, 0x23FFFFFF, 0xFF010000, 0xF807FFF3, 0xFFF99FE0, 0x23C5FDFF, 0xB0004000, 0x0003FFC3,
|
|
0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001CFFC0, 0xFFFBBFE0, 0x23EDFDFF, 0x00010000, 0x0000FFC3,
|
|
0xFFF99FE0, 0x23EDFDFF, 0xB0000000, 0x0002FFC3, 0xD63DC7E8, 0x03FFC718, 0x00010000, 0x0000FFC0,
|
|
0xFFFDDFE0, 0x23EFFDFF, 0x03000000, 0x0000FFC3, 0xFFFDDFE0, 0x23EFFDFF, 0x40000000, 0x0000FFC3,
|
|
0xFFFDDFE0, 0x23FFFDFF, 0x00000000, 0xFC00FFC3, 0xFC7FFFE0, 0x2FFBFFFF, 0x0000007F, 0x00100000,
|
|
0xFFFFFFFE, 0x07FFFFFF, 0x0FFFFFFF, 0x00000000, 0xFEF02596, 0x200DECAE, 0x33FF005F, 0x00000000,
|
|
0x0007FFF1, 0x3C0003FF, 0xFFFFFEFF, 0x00001FFF, 0x00000F20, 0x00000000, 0x001F0000, 0x00000000,
|
|
0xFFFFFFFF, 0x800007FF, 0x3C3FFFFF, 0xFFE1C062, 0x03FF4003, 0xFFFFFFFF, 0xFFFF003F, 0x1FFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFF07, 0xFFFFFFFF, 0x03FFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0x3D7F3DFF, 0xFFFFFFFF, 0xFFFF3DFF, 0x7F3DFFFF, 0xFF7FFF3D, 0xFFFFFFFF,
|
|
0xFF3DFFFF, 0xFFFFFFFF, 0x07FFFFFF, 0x000001FE, 0x0000FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x001FFFFF,
|
|
0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x007FFFFF, 0x1FFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0x0001FFFF,
|
|
0x0003DFFF, 0x0063FFFF, 0x0003FFFF, 0x0001DFFF, 0xFFFFFFFF, 0x000FFFFF, 0x17F00000, 0x000003FF,
|
|
0x03FF07FF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00FFFFFF, 0xFFFFFFFF, 0x000005FF, 0x00000000, 0x00000000,
|
|
0x1FFFFFFF, 0x00000000, 0xFFFFFFF0, 0x001F3FFF, 0xFFFFFFFF, 0x000003FF, 0xC3FF00FE, 0x00000000,
|
|
0xC07FFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0xFFFFFFE0, 0x000FFFFF, 0xFFFF0FE0, 0x00000001, 0xFFFFFFF8, 0x03FFC001, 0x00000000, 0x00000000,
|
|
0xFFFFFFFF, 0xF800000F, 0xFFFFE3FF, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, 0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
|
|
0xFFFF0000, 0xFFFF00FF, 0x7FFBFFEF, 0xE0020000, 0x001F6000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x3E2FFC84, 0xF3FFBD50, 0x000043E0, 0xFFFFFFFF, 0x000001FF, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000600, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x003FFF00, 0x00000000, 0x00000000, 0x00000060, 0x0000FFC0,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01FFFFF8, 0x00000000, 0x0F000000, 0x30000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0xFFFFFFFF, 0xFFFF7FFF, 0x7FFFFFFF, 0x3FFEFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xDE00001F,
|
|
0xFFFFFFFF, 0xFFFF003F, 0xFFFFFFFF, 0x0000803F, 0x007FFFFF, 0x7F7F7F7F, 0x7F7F7F7F, 0x00000000,
|
|
0xFFFFFFFF, 0x00017FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0xFFF3FFEF, 0x3F3F03FE, 0xFFFFFFFE, 0xFFFFFFFF, 0xE07FFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFE0, 0xFFFE3FFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00007FFF, 0x00FFFFFF, 0x00000000, 0xFFFF0000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFF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 0x00000000, 0xF8000000,
|
|
0xFFFFF7BB, 0x00000007, 0xFFFFFFFF, 0x00FFFFFF, 0xFFFFFFFC, 0x000FFFFF, 0x03FFC000, 0x00000000,
|
|
0xFFFFFFFF, 0xFFFFC03F, 0x8000007F, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0xFFFFFFFF, 0x000001FF, 0xF3FF0FF7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFF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FFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFF3FFF, 0xFFFFFFFF, 0xFFFF07FF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, 0x00000000,
|
|
0xA0F8007F, 0x5F7FFDFF, 0xFFFFFFDB, 0xFFFFFFFF, 0xFFFFFFFF, 0x0003FFFF, 0xFFF80000, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
|
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF0000, 0xFFFFFFFF, 0xFFFCFFFF, 0xFFFFFFFF, 0x000000FF, 0x0FFF0000,
|
|
0x03FF0000, 0xFFFF0000, 0xFFF7FFFF, 0xFFDF0D0B, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x9FFFFFFF,
|
|
0x8FFFF7EE, 0xBFFFFFFF, 0xAFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF, 0x1CFCFCFC, 0x00000000
|
|
};
|
|
#pragma endregion
|
|
|
|
bool Q_iswprint(uchar16 c)
|
|
{
|
|
return (g_isPrintTable[c / 32] & (1 << (c % 32))) != 0;
|
|
}
|
|
|
|
// Determine if a uchar32 represents a valid Unicode code point
|
|
bool Q_IsValidUChar32(uchar32 uVal)
|
|
{
|
|
// Values > 0x10FFFF are explicitly invalid; ditto for UTF-16 surrogate halves,
|
|
// values ending in FFFE or FFFF, or values in the 0x00FDD0-0x00FDEF reserved range
|
|
return (uVal < 0x110000u) && ((uVal - 0x00D800u) > 0x7FFu) && ((uVal & 0xFFFFu) < 0xFFFEu) && ((uVal - 0x00FDD0u) > 0x1Fu);
|
|
}
|
|
|
|
// Returns true if a wide character is a "mean" space; that is,
|
|
// if it is technically a space or punctuation, but causes disruptive
|
|
// behavior when used in names, web pages, chat windows, etc.
|
|
//
|
|
// Characters in this set are removed from the beginning and/or end of strings
|
|
// by Q_AggressiveStripPrecedingAndTrailingWhitespaceW()
|
|
bool Q_IsMeanSpaceW(uchar16 wch)
|
|
{
|
|
bool bIsMean = false;
|
|
|
|
switch (wch)
|
|
{
|
|
case 0x0082: // BREAK PERMITTED HERE
|
|
case 0x0083: // NO BREAK PERMITTED HERE
|
|
case 0x00A0: // NO-BREAK SPACE
|
|
case 0x034F: // COMBINING GRAPHEME JOINER
|
|
case 0x2000: // EN QUAD
|
|
case 0x2001: // EM QUAD
|
|
case 0x2002: // EN SPACE
|
|
case 0x2003: // EM SPACE
|
|
case 0x2004: // THICK SPACE
|
|
case 0x2005: // MID SPACE
|
|
case 0x2006: // SIX SPACE
|
|
case 0x2007: // FIGURE SPACE
|
|
case 0x2008: // PUNCTUATION SPACE
|
|
case 0x2009: // THIN SPACE
|
|
case 0x200A: // HAIR SPACE
|
|
case 0x200B: // ZERO-WIDTH SPACE
|
|
case 0x200C: // ZERO-WIDTH NON-JOINER
|
|
case 0x200D: // ZERO WIDTH JOINER
|
|
case 0x2028: // LINE SEPARATOR
|
|
case 0x2029: // PARAGRAPH SEPARATOR
|
|
case 0x202F: // NARROW NO-BREAK SPACE
|
|
case 0x2060: // WORD JOINER
|
|
case 0x3000: // IDEOGRAPHIC SPACE
|
|
case 0xFEFF: // ZERO-WIDTH NO BREAK SPACE
|
|
case 0xFFFC: // OBJECT REPLACEMENT CHARACTER
|
|
bIsMean = true;
|
|
break;
|
|
}
|
|
|
|
return bIsMean;
|
|
}
|
|
|
|
bool Q_IsUnprintableW(uchar16 c)
|
|
{
|
|
#ifdef UNICODE_FIXES
|
|
return !Q_iswprint(c);
|
|
#else
|
|
switch (c)
|
|
{
|
|
case 0x202A:
|
|
case 0x202B:
|
|
case 0x202C:
|
|
case 0x202D:
|
|
case 0x202E:
|
|
case 0x206A:
|
|
case 0x206B:
|
|
case 0x206C:
|
|
case 0x206D:
|
|
case 0x206E:
|
|
case 0x206F:
|
|
return true;
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
#endif // UNICODE_FIXES
|
|
}
|
|
|
|
// Returns false if UTF-8 string contains invalid sequences.
|
|
bool Q_UnicodeValidate(const char *pUTF8)
|
|
{
|
|
bool bError = false;
|
|
while (*pUTF8)
|
|
{
|
|
uchar32 uVal;
|
|
// Our UTF-8 decoder silently fixes up 6-byte CESU-8 (improperly re-encoded UTF-16) sequences.
|
|
// However, these are technically not valid UTF-8. So if we eat 6 bytes at once, it's an error.
|
|
int nCharSize = Q_UTF8ToUChar32(pUTF8, uVal, bError);
|
|
if (bError || nCharSize == 6)
|
|
return false;
|
|
pUTF8 += nCharSize;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// Strips trailing whitespace; returns pointer inside string just past
|
|
// any leading whitespace.
|
|
//
|
|
// bAggressive = true causes this function to also check for "mean" spaces,
|
|
// which we don't want in persona names or chat strings as they're disruptive
|
|
// to the user experience.
|
|
static uchar16 *StripWhitespaceWorker(uchar16 *pwch, int cchLength, bool *pbStrippedWhitespace, bool bAggressive)
|
|
{
|
|
// walk backwards from the end of the string, killing any whitespace
|
|
*pbStrippedWhitespace = false;
|
|
|
|
uchar16 *pwchEnd = pwch + cchLength;
|
|
while (--pwchEnd >= pwch)
|
|
{
|
|
if (!iswspace(*pwchEnd) && (!bAggressive || !Q_IsMeanSpaceW(*pwchEnd)))
|
|
break;
|
|
|
|
*pwchEnd = 0;
|
|
*pbStrippedWhitespace = true;
|
|
}
|
|
|
|
// walk forward in the string
|
|
while (pwch < pwchEnd)
|
|
{
|
|
if (!iswspace(*pwch))
|
|
break;
|
|
|
|
*pbStrippedWhitespace = true;
|
|
pwch++;
|
|
}
|
|
|
|
return pwch;
|
|
}
|
|
|
|
static uchar16 *StripUnprintableWorker(uchar16 *pwch, bool *pStripped)
|
|
{
|
|
uchar16 *rPos = pwch;
|
|
uchar16 *wPos = pwch;
|
|
*pStripped = false;
|
|
|
|
while(*rPos)
|
|
{
|
|
uchar16 cc = *rPos;
|
|
if (*rPos >= 0x20u && !Q_IsUnprintableW(cc) && cc != 0x2026)
|
|
{
|
|
*wPos = cc;
|
|
wPos++;
|
|
}
|
|
|
|
rPos++;
|
|
}
|
|
|
|
*wPos = 0;
|
|
*pStripped = rPos != wPos;
|
|
return pwch;
|
|
}
|
|
|
|
// Strips leading and trailing whitespace
|
|
bool Q_StripPrecedingAndTrailingWhitespace(char *pch)
|
|
{
|
|
int cch = Q_strlen(pch);
|
|
|
|
// Early out and don't convert if we don't have any chars or leading/trailing ws.
|
|
if ((cch < 1) || (!isspace((unsigned char)pch[0]) && !isspace((unsigned char)pch[cch - 1])))
|
|
return false;
|
|
|
|
// convert to unicode
|
|
int cubDest = (cch + 1) * sizeof(uchar16);
|
|
uchar16 *pwch = (uchar16 *)alloca(cubDest);
|
|
int cwch = (unsigned int)Q_UTF8ToUTF16(pch, (uchar16 *)pwch, cubDest, _STRINGCONVERTFLAG_ASSERT) >> 1;
|
|
|
|
bool bStrippedWhitespace = false;
|
|
pwch = StripWhitespaceWorker(pwch, cwch - 1, &bStrippedWhitespace, false /* not aggressive */);
|
|
|
|
// copy back, if necessary
|
|
if (bStrippedWhitespace)
|
|
{
|
|
Q_UTF16ToUTF8(pwch, pch, cch, STRINGCONVERT_ASSERT_REPLACE);
|
|
}
|
|
|
|
return bStrippedWhitespace;
|
|
}
|
|
|
|
// Strips leading and trailing whitespace,
|
|
// also all non-printable characters (ie. zero-width no-break space) from a string.
|
|
bool Q_StripUnprintableAndSpace(char *pch)
|
|
{
|
|
// duplicate on stack
|
|
int cch = Q_strlen(pch);
|
|
int cubDest = (cch + 1) * sizeof(uchar16);
|
|
uchar16 *pwch = (uchar16 *)alloca(cubDest);
|
|
int cwch = (unsigned int)Q_UTF8ToUTF16(pch, (uchar16 *)pwch, cubDest, _STRINGCONVERTFLAG_ASSERT) >> 1;
|
|
|
|
bool bStrippedAny = false;
|
|
pwch = StripUnprintableWorker(pwch, &bStrippedAny);
|
|
|
|
bool bStrippedWhitespace = false;
|
|
pwch = StripWhitespaceWorker(pwch, cwch - 1, &bStrippedWhitespace, true /* is aggressive */);
|
|
|
|
// copy back, if necessary
|
|
if (bStrippedWhitespace || bStrippedAny)
|
|
{
|
|
Q_UTF16ToUTF8(pwch, pch, cch, STRINGCONVERT_ASSERT_REPLACE);
|
|
}
|
|
|
|
return bStrippedAny;
|
|
}
|
|
|
|
int Q_UChar32ToUTF32(uchar32 uVal, uchar32 *pUTF32)
|
|
{
|
|
if (uVal <= 0xFFFF)
|
|
{
|
|
pUTF32[0] = (uchar32)uVal;
|
|
return 1;
|
|
}
|
|
|
|
pUTF32[0] = (uchar32)((uVal - 0x10000) >> 10) | 0xD800;
|
|
pUTF32[1] = (uchar32)(uVal & 0x3FF) | 0xDC00;
|
|
return 2;
|
|
}
|
|
|
|
int Q_UChar32ToUTF32Len(uchar32 uVal)
|
|
{
|
|
if (uVal <= 0xFFFF)
|
|
return 1;
|
|
|
|
return 2;
|
|
}
|
|
|
|
// Encode Unicode code point as UTF-16, returns number of elements written
|
|
int Q_UChar32ToUTF16(uchar32 uVal, uchar16 *pUTF16Out)
|
|
{
|
|
if (uVal <= 0xFFFF)
|
|
{
|
|
pUTF16Out[0] = (uchar16)uVal;
|
|
return 1;
|
|
}
|
|
|
|
pUTF16Out[0] = (uchar16)((uVal - 0x10000) >> 10) | 0xD800;
|
|
pUTF16Out[1] = (uchar16)(uVal & 0x3FF) | 0xDC00;
|
|
return 2;
|
|
}
|
|
|
|
// Return number of UTF-16 elements required to encode a Unicode code point
|
|
int Q_UChar32ToUTF16Len(uchar32 uVal)
|
|
{
|
|
if (uVal <= 0xFFFF)
|
|
return 1;
|
|
|
|
return 2;
|
|
}
|
|
|
|
// Encode Unicode code point as UTF-8, returns number of bytes written
|
|
int Q_UChar32ToUTF8(uchar32 uVal, char *pUTF8Out)
|
|
{
|
|
if (uVal <= 0x7F)
|
|
{
|
|
pUTF8Out[0] = (unsigned char)uVal;
|
|
return 1;
|
|
}
|
|
|
|
if (uVal <= 0x7FF)
|
|
{
|
|
pUTF8Out[0] = (unsigned char)(uVal >> 6) | 0xC0;
|
|
pUTF8Out[1] = (unsigned char)(uVal & 0x3F) | 0x80;
|
|
return 2;
|
|
}
|
|
|
|
if (uVal <= 0xFFFF)
|
|
{
|
|
pUTF8Out[0] = (unsigned char)(uVal >> 12) | 0xE0;
|
|
pUTF8Out[1] = (unsigned char)((uVal >> 6) & 0x3F) | 0x80;
|
|
pUTF8Out[2] = (unsigned char)(uVal & 0x3F) | 0x80;
|
|
return 3;
|
|
}
|
|
|
|
pUTF8Out[0] = (unsigned char)((uVal >> 18) & 0x07) | 0xF0;
|
|
pUTF8Out[1] = (unsigned char)((uVal >> 12) & 0x3F) | 0x80;
|
|
pUTF8Out[2] = (unsigned char)((uVal >> 6) & 0x3F) | 0x80;
|
|
pUTF8Out[3] = (unsigned char)(uVal & 0x3F) | 0x80;
|
|
return 4;
|
|
}
|
|
|
|
// Return number of UTF-8 bytes required to encode a Unicode code point
|
|
int Q_UChar32ToUTF8Len(uchar32 uVal)
|
|
{
|
|
if (uVal <= 0x7F)
|
|
return 1;
|
|
|
|
if (uVal <= 0x7FF)
|
|
return 2;
|
|
|
|
if (uVal <= 0xFFFF)
|
|
return 3;
|
|
|
|
return 4;
|
|
}
|
|
|
|
// Decode one character from a UTF-8 encoded string. Treats 6-byte CESU-8 sequences
|
|
// as a single character, as if they were a correctly-encoded 4-byte UTF-8 sequence.
|
|
int Q_UTF8ToUChar32(const char *pUTF8_, uchar32 &uValueOut, bool &bErrorOut)
|
|
{
|
|
const uint8 *pUTF8 = (const uint8 *)pUTF8_;
|
|
|
|
int nBytes = 1;
|
|
uint32 uValue = pUTF8[0];
|
|
uint32 uMinValue = 0;
|
|
|
|
// 0....... single byte
|
|
if (uValue < 0x80)
|
|
goto decodeFinishedNoCheck;
|
|
|
|
// Expecting at least a two-byte sequence with 0xC0 <= first <= 0xF7 (110...... and 11110...)
|
|
if ((uValue - 0xC0u) > 0x37u || (pUTF8[1] & 0xC0) != 0x80)
|
|
goto decodeError;
|
|
|
|
uValue = (uValue << 6) - (0xC0 << 6) + pUTF8[1] - 0x80;
|
|
nBytes = 2;
|
|
uMinValue = 0x80;
|
|
|
|
// 110..... two-byte lead byte
|
|
if (!(uValue & (0x20 << 6)))
|
|
goto decodeFinished;
|
|
|
|
// Expecting at least a three-byte sequence
|
|
if ((pUTF8[2] & 0xC0) != 0x80)
|
|
goto decodeError;
|
|
|
|
uValue = (uValue << 6) - (0x20 << 12) + pUTF8[2] - 0x80;
|
|
nBytes = 3;
|
|
uMinValue = 0x800;
|
|
|
|
// 1110.... three-byte lead byte
|
|
if (!(uValue & (0x10 << 12)))
|
|
goto decodeFinishedMaybeCESU8;
|
|
|
|
// Expecting a four-byte sequence, longest permissible in UTF-8
|
|
if ((pUTF8[3] & 0xC0) != 0x80)
|
|
goto decodeError;
|
|
|
|
uValue = (uValue << 6) - (0x10 << 18) + pUTF8[3] - 0x80;
|
|
nBytes = 4;
|
|
uMinValue = 0x10000;
|
|
|
|
// 11110... four-byte lead byte. fall through to finished.
|
|
decodeFinished:
|
|
if (uValue >= uMinValue && Q_IsValidUChar32(uValue))
|
|
{
|
|
decodeFinishedNoCheck:
|
|
uValueOut = uValue;
|
|
bErrorOut = false;
|
|
return nBytes;
|
|
}
|
|
|
|
decodeError:
|
|
uValueOut = '?';
|
|
bErrorOut = true;
|
|
return nBytes;
|
|
|
|
decodeFinishedMaybeCESU8:
|
|
// Do we have a full UTF-16 surrogate pair that's been UTF-8 encoded afterwards?
|
|
// That is, do we have 0xD800-0xDBFF followed by 0xDC00-0xDFFF? If so, decode it all.
|
|
if ((uValue - 0xD800u) < 0x400u && pUTF8[3] == 0xED && (uint8)(pUTF8[4] - 0xB0) < 0x10 && (pUTF8[5] & 0xC0) == 0x80)
|
|
{
|
|
uValue = 0x10000 + ((uValue - 0xD800u) << 10) + ((uint8)(pUTF8[4] - 0xB0) << 6) + pUTF8[5] - 0x80;
|
|
nBytes = 6;
|
|
uMinValue = 0x10000;
|
|
}
|
|
|
|
goto decodeFinished;
|
|
}
|
|
|
|
// Decode one character from a UTF-16 encoded string
|
|
int Q_UTF16ToUChar32(const uchar16 *pUTF16, uchar32 &uValueOut, bool &bErrorOut)
|
|
{
|
|
if (Q_IsValidUChar32(pUTF16[0]))
|
|
{
|
|
uValueOut = pUTF16[0];
|
|
bErrorOut = false;
|
|
return 1;
|
|
}
|
|
else if (pUTF16[0] - 0xD800u < 0x400u && (pUTF16[1] - 0xDC00u) < 0x400u)
|
|
{
|
|
// Valid surrogate pair, but maybe not encoding a valid Unicode code point...
|
|
uchar32 uVal = 0x010000 + ((pUTF16[0] - 0xD800u) << 10) + (pUTF16[1] - 0xDC00u);
|
|
if (Q_IsValidUChar32(uValueOut))
|
|
{
|
|
uValueOut = uVal;
|
|
bErrorOut = false;
|
|
return 2;
|
|
}
|
|
else
|
|
{
|
|
uValueOut = '?';
|
|
bErrorOut = true;
|
|
return 2;
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
uValueOut = '?';
|
|
bErrorOut = true;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
// Decode one character from a UTF-32 encoded string
|
|
int Q_UTF32ToUChar32(const uchar32 *pUTF32, uchar32 &uValueOut, bool &bErrorOut)
|
|
{
|
|
if (Q_IsValidUChar32(pUTF32[0]))
|
|
{
|
|
uValueOut = pUTF32[0];
|
|
bErrorOut = false;
|
|
return 1;
|
|
}
|
|
else if (pUTF32[0] - 0xD800u < 0x400u && (pUTF32[1] - 0xDC00u) < 0x400u)
|
|
{
|
|
// Valid surrogate pair, but maybe not encoding a valid Unicode code point...
|
|
uchar32 uVal = 0x010000 + ((pUTF32[0] - 0xD800u) << 10) + (pUTF32[1] - 0xDC00u);
|
|
if (Q_IsValidUChar32(uVal))
|
|
{
|
|
uValueOut = uVal;
|
|
bErrorOut = false;
|
|
return 2;
|
|
}
|
|
else
|
|
{
|
|
uValueOut = '?';
|
|
bErrorOut = true;
|
|
return 2;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
uValueOut = '?';
|
|
bErrorOut = true;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
// A generic Unicode processing loop: decode one character from input to uchar32, handle errors, encode uchar32 to output
|
|
template <typename SrcType, typename DstType, bool bStopAtNull,
|
|
qboolean (*DecodeSrc)(const SrcType *pUTF8, uchar32 &uValueOut, bool &bErrorOut),
|
|
int (EncodeDstLen)(uchar32 uVal),
|
|
int (EncodeDst)(uchar32 uVal, DstType *pUTF8Out)>
|
|
int Q_UnicodeConvertT(const SrcType *pIn, int nInChars, DstType *pOut, int nOutBytes, EStringConvertErrorPolicy ePolicy)
|
|
{
|
|
if (nOutBytes == 0)
|
|
return 0;
|
|
|
|
int nOut = 0;
|
|
if (!pOut)
|
|
{
|
|
while (bStopAtNull ? (*pIn) : (nInChars-- > 0))
|
|
{
|
|
uchar32 uVal = '?';
|
|
bool bErr = false; // Initialize in order to avoid /analyze warnings.
|
|
|
|
pIn += DecodeSrc(pIn, uVal, bErr);
|
|
nOut += EncodeDstLen(uVal);
|
|
|
|
if (bErr)
|
|
{
|
|
DbgAssertMsg(!(ePolicy & _STRINGCONVERTFLAG_ASSERT), "invalid Unicode byte sequence");
|
|
|
|
if (ePolicy & _STRINGCONVERTFLAG_SKIP)
|
|
{
|
|
nOut -= EncodeDstLen(uVal);
|
|
}
|
|
else if (ePolicy & _STRINGCONVERTFLAG_FAIL)
|
|
{
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
int nOutElems = nOutBytes / sizeof(DstType);
|
|
if (nOutElems <= 0)
|
|
{
|
|
pOut[0] = 0;
|
|
return 0;
|
|
}
|
|
|
|
int nMaxOut = nOutElems - 1; // print symbols count
|
|
while (bStopAtNull ? (*pIn) : (nInChars-- > 0))
|
|
{
|
|
uchar32 uVal = '?';
|
|
bool bErr = false; // Initialize in order to avoid /analyze warnings.
|
|
|
|
pIn += DecodeSrc(pIn, uVal, bErr);
|
|
|
|
if (nOut + EncodeDstLen(uVal) > nMaxOut)
|
|
break;
|
|
|
|
nOut += EncodeDst(uVal, pOut + nOut);
|
|
if (bErr)
|
|
{
|
|
DbgAssertMsg(!(ePolicy & _STRINGCONVERTFLAG_ASSERT), "invalid Unicode byte sequence");
|
|
|
|
if (ePolicy & _STRINGCONVERTFLAG_SKIP)
|
|
{
|
|
nOut -= EncodeDstLen(uVal);
|
|
}
|
|
else if (ePolicy & _STRINGCONVERTFLAG_FAIL)
|
|
{
|
|
pOut[0] = 0;
|
|
return 0;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
pOut[nOut] = 0;
|
|
}
|
|
|
|
return (nOut + 1) * sizeof(DstType);
|
|
}
|
|
|
|
// Perform conversion. Returns number of *bytes* required if output pointer is NULL.
|
|
int Q_UTF8ToUTF16(const char *pUTF8, uchar16 *pUTF16, int cubDestSizeInBytes, EStringConvertErrorPolicy ePolicy)
|
|
{
|
|
return Q_UnicodeConvertT<char, uchar16, true, Q_UTF8ToUChar32, Q_UChar32ToUTF16Len, Q_UChar32ToUTF16>(pUTF8, 0, pUTF16, cubDestSizeInBytes, ePolicy);
|
|
}
|
|
|
|
// Perform conversion. Returns number of *bytes* required if output pointer is NULL.
|
|
int Q_UTF8ToUTF32(const char *pUTF8, uchar32 *pUTF32, int cubDestSizeInBytes, EStringConvertErrorPolicy ePolicy)
|
|
{
|
|
return Q_UnicodeConvertT<char, uchar32, true, Q_UTF8ToUChar32, Q_UChar32ToUTF32Len, Q_UChar32ToUTF32>(pUTF8, 0, pUTF32, cubDestSizeInBytes, ePolicy);
|
|
}
|
|
|
|
// Perform conversion. Returns number of *bytes* required if output pointer is NULL.
|
|
int Q_UTF16ToUTF8(const uchar16 *pUTF16, char *pUTF8, int cubDestSizeInBytes, EStringConvertErrorPolicy ePolicy)
|
|
{
|
|
return Q_UnicodeConvertT<uchar16, char, true, Q_UTF16ToUChar32, Q_UChar32ToUTF8Len, Q_UChar32ToUTF8>(pUTF16, 0, pUTF8, cubDestSizeInBytes, ePolicy);
|
|
}
|
|
|
|
// Perform conversion. Returns number of *bytes* required if output pointer is NULL.
|
|
int Q_UTF16ToUTF32(const uchar16 *pUTF16, uchar32 *pUTF32, int cubDestSizeInBytes, EStringConvertErrorPolicy ePolicy)
|
|
{
|
|
return Q_UnicodeConvertT<uchar16, uchar32, true, Q_UTF16ToUChar32, Q_UChar32ToUTF32Len, Q_UChar32ToUTF32>(pUTF16, 0, pUTF32, cubDestSizeInBytes, ePolicy);
|
|
}
|
|
|
|
// Perform conversion. Returns number of *bytes* required if output pointer is NULL.
|
|
int Q_UTF32ToUTF8(const uchar32 *pUTF32, char *pUTF8, int cubDestSizeInBytes, EStringConvertErrorPolicy ePolicy)
|
|
{
|
|
return Q_UnicodeConvertT<uchar32, char, true, Q_UTF32ToUChar32, Q_UChar32ToUTF8Len, Q_UChar32ToUTF8>(pUTF32, 0, pUTF8, cubDestSizeInBytes, ePolicy);
|
|
}
|
|
|
|
// Perform conversion. Returns number of *bytes* required if output pointer is NULL.
|
|
int Q_UTF32ToUTF16(const uchar32 *pUTF32, uchar16 *pUTF16, int cubDestSizeInBytes, EStringConvertErrorPolicy ePolicy)
|
|
{
|
|
return Q_UnicodeConvertT<uchar32, uchar16, true, Q_UTF32ToUChar32, Q_UChar32ToUTF16Len, Q_UChar32ToUTF16>(pUTF32, 0, pUTF16, cubDestSizeInBytes, ePolicy);
|
|
}
|
|
|
|
// Repair a UTF-8 string by removing or replacing invalid seqeuences. Returns non-zero on success.
|
|
int Q_UnicodeRepair(char *pUTF8)
|
|
{
|
|
return Q_UnicodeConvertT<char, char, true, Q_UTF8ToUChar32, Q_UChar32ToUTF8Len, Q_UChar32ToUTF8>(pUTF8, 0, pUTF8, 65535, STRINGCONVERT_SKIP);
|
|
}
|
|
|
|
// Returns number of Unicode code points (aka glyphs / characters) encoded in the UTF-8 string
|
|
int Q_UnicodeLength(const char *pUTF8)
|
|
{
|
|
int nChars = 0;
|
|
while (*pUTF8)
|
|
{
|
|
bool bError;
|
|
uchar32 uVal;
|
|
pUTF8 += Q_UTF8ToUChar32(pUTF8, uVal, bError);
|
|
nChars++;
|
|
}
|
|
|
|
return nChars;
|
|
}
|
|
|
|
// Advance a UTF-8 string pointer by a certain number of Unicode code points, stopping at end of string
|
|
char *Q_UnicodeAdvance(char *pUTF8, int nChars)
|
|
{
|
|
while (nChars > 0 && *pUTF8)
|
|
{
|
|
bool bError;
|
|
uchar32 uVal;
|
|
pUTF8 += Q_UTF8ToUChar32(pUTF8, uVal, bError);
|
|
nChars--;
|
|
}
|
|
|
|
return pUTF8;
|
|
}
|