Changeset View
Changeset View
Standalone View
Standalone View
source/lib/utf8.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* | * | ||||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | ||||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | ||||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | ||||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | ||||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | ||||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | ||||
* the following conditions: | * the following conditions: | ||||
Show All 18 Lines | static const StatusDefinition utf8StatusDefinitions[] = { | ||||
{ ERR::UTF8_SURROGATE, L"UTF-16 surrogate pairs aren't supported" }, | { ERR::UTF8_SURROGATE, L"UTF-16 surrogate pairs aren't supported" }, | ||||
{ ERR::UTF8_OUTSIDE_BMP, L"Code point outside BMP (> 0x10000)" }, | { ERR::UTF8_OUTSIDE_BMP, L"Code point outside BMP (> 0x10000)" }, | ||||
{ ERR::UTF8_NONCHARACTER, L"Noncharacter (e.g. WEOF)" }, | { ERR::UTF8_NONCHARACTER, L"Noncharacter (e.g. WEOF)" }, | ||||
{ ERR::UTF8_INVALID_UTF8, L"Invalid UTF-8 sequence" } | { ERR::UTF8_INVALID_UTF8, L"Invalid UTF-8 sequence" } | ||||
}; | }; | ||||
STATUS_ADD_DEFINITIONS(utf8StatusDefinitions); | STATUS_ADD_DEFINITIONS(utf8StatusDefinitions); | ||||
// adapted from http://unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.c | // Adapted from http://unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.c | ||||
// (which is no longer accessible but a backup can can be found at: | |||||
// https://web.archive.org/web/20090523031611/http://www.unicode.org:80/Public/PROGRAMS/CVTUTF/ConvertUTF.c ) | |||||
// which bears the following notice: | // which bears the following notice: | ||||
/* | /* | ||||
* Copyright 2001-2004 Unicode, Inc. | * Copyright 2001-2004 Unicode, Inc. | ||||
* | * | ||||
* Disclaimer | * Disclaimer | ||||
* | * | ||||
* This source code is provided as is by Unicode, Inc. No claims are | * This source code is provided as is by Unicode, Inc. No claims are | ||||
* made as to fitness for any particular purpose. No warranties of any | * made as to fitness for any particular purpose. No warranties of any | ||||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator