mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 07:03:36 -04:00
dcparser: Improve assertion error message for invalid UTF-8 data
This commit is contained in:
parent
cd9712270b
commit
ca061c98a6
@ -889,6 +889,10 @@ unpack_object() {
|
||||
unpack_string(str);
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
object = PyUnicode_FromStringAndSize(str.data(), str.size());
|
||||
if (object == nullptr) {
|
||||
nassert_raise("Unable to decode UTF-8 string; use blob type for binary data");
|
||||
return nullptr;
|
||||
}
|
||||
#else
|
||||
object = PyString_FromStringAndSize(str.data(), str.size());
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user