MCPcopy Create free account
hub / github.com/GNOME/gjs / gjs_string_from_utf8

Function gjs_string_from_utf8

gjs/jsapi-util-string.cpp:186–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186bool gjs_string_from_utf8(JSContext* cx, const char* utf8_string,
187 JS::MutableHandleValue value_p) {
188 JS::ConstUTF8CharsZ chars(utf8_string, strlen(utf8_string));
189 JS::RootedString str{cx, JS_NewStringCopyUTF8Z(cx, chars)};
190 if (!str)
191 return false;
192
193 value_p.setString(str);
194 return true;
195}
196
197bool gjs_string_from_utf8_n(JSContext* cx, const char* utf8_chars, size_t len,
198 JS::MutableHandleValue out) {

Callers 15

gjs_address_ofFunction · 0.85
gjs_address_of_gobjectFunction · 0.85
get_messageMethod · 0.85
to_stringMethod · 0.85
gjs_error_from_js_gerrorFunction · 0.85
gjs_array_from_strvFunction · 0.85
get_nameMethod · 0.85
to_string_implMethod · 0.85

Calls

no outgoing calls