Skip to content
  • Philip Chimento's avatar
    jsapi-util-string: Use mozjs UTF8-to-JSString conversion · 6fa31261
    Philip Chimento authored
    There are two paths for decoding UTF8 strings directly to JSString:
    JS_NewStringCopyUTF8N() and JS_NewStringCopyUTF8Z(). Mostly we have a
    zero-terminated string in GJS, so we shorten gjs_string_from_utf8() to
    remove its string length argument and use JS_NewStringCopyUTF8Z().
    
    There are a few places where we have a non-zero-terminated string, so we
    introduce gjs_string_from_utf8_n() to handle that path.
    
    A few places we were doing a UTF8 conversion where it was not necessary.
    6fa31261