Files
AnyPS5/core/libs/prx/libSceIcu/Character.cpp
T
MarcZX10 6173e23a23 feat(libSceIcu): implement u_getISOComment
Return the ISO 10646 comment of a code point as ICU 78.1 unames.cpp does
without character name data: it is the empty string for every code point.
A null or failed status returns 0 untouched, a negative capacity or a
null destination with a positive capacity sets U_ILLEGAL_ARGUMENT_ERROR,
and otherwise the destination is NUL-terminated with the usual
U_STRING_NOT_TERMINATED_WARNING when the capacity is zero.

The sceIcuUnknown stub with this NID is removed.
2026-11-05 21:55:34 +00:00

28 lines
878 B
C++

#include "prx/libSceIcu/libSceIcu.hpp"
#include "prx/libSceIcu/Status.hpp"
#include <cstdint>
extern "C" {
std::int8_t APS5_VABI u_isISOControl_nid_postfix(std::int32_t character) {
return static_cast<std::uint32_t>(character) <= 0x9f && (character <= 0x1f || character >= 0x7f);
}
std::int32_t APS5_VABI u_forDigit_nid_postfix(std::int32_t digit, std::int8_t radix) {
if (radix < 2 || radix > 36 || digit < 0 || digit >= radix) return 0;
return digit < 10 ? '0' + digit : 'a' - 10 + digit;
}
std::int32_t APS5_VABI u_getISOComment_nid_postfix(std::int32_t, char* destination, std::int32_t capacity, std::int32_t* status) {
if (!status || *status > 0) return 0;
if (capacity < 0 || (capacity > 0 && !destination)) {
*status = Icu::IllegalArgument;
return 0;
}
Icu::Terminate(destination, capacity, 0, status);
return 0;
}
}