convert utf8 poolbytearray to string in nativescritps c++

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By alireza49

in GDscript we can converts value of utf8 which are stroed in PoolByteArray to string using get_string_from_utf8 function in String. i want to know is there any way to do this in c++ nativescript?? i looked at the godot String class in c++ and there isn’t such function there, so is it possible at all?

thank you in advance.

i think the answer is to use one of the String class constructor, which takes a const char . first we need to convert poolbytearray to char, using “poolbytearray().read().ptr()”. but i’m not sure if its correct or not

alireza49 | 2020-01-01 05:57