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

Function gjs_string_from_utf8_n

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

Source from the content-addressed store, hash-verified

195}
196
197bool gjs_string_from_utf8_n(JSContext* cx, const char* utf8_chars, size_t len,
198 JS::MutableHandleValue out) {
199 JS::UTF8Chars chars(utf8_chars, len);
200 JS::RootedString str(cx, JS_NewStringCopyUTF8N(cx, chars));
201 if (str)
202 out.setString(str);
203
204 return !!str;
205}
206
207bool gjs_string_to_filename(JSContext* cx, const JS::Value filename_val,
208 Gjs::AutoChar* filename_string) {

Calls

no outgoing calls

Tested by 1