是否有正确的方法来识别Java/Kotlin中的Unicode私有使用区域(PUA)字符?
一些背景,我们正在使用PDF转换工具,它不支持PUA字符。因此,我们需要标识文件中可用的任何PUA字符。那么,什么是一种无恶意、可靠的检测PUA字符的方法呢?
发布于 2022-04-20 12:04:27
以下是两种“适当”的方法:
int cp = ... // a Unicode codepoint represented as an int
if (Character.isType(cp) == Character.PRIVATE_USE) {
// ...
}
if (Character.UnicodeBlock.of(cp) == Character.UnicodeBlock.PRIVATE_USE_AREA) {
// ...
}
https://stackoverflow.com/questions/71939179
复制相似问题