diff --git a/dom/bluetooth/BluetoothUtils.cpp b/dom/bluetooth/BluetoothUtils.cpp index 05db1e6fa257..1949a3799cf2 100644 --- a/dom/bluetooth/BluetoothUtils.cpp +++ b/dom/bluetooth/BluetoothUtils.cpp @@ -27,9 +27,9 @@ SetJsObject(JSContext* aContext, jsval v; if (aData[i].value().type() == BluetoothValue::TnsString) { nsString data = aData[i].value().get_nsString(); - JSString* JsData = JS_NewStringCopyN(aContext, - NS_ConvertUTF16toUTF8(data).get(), - data.Length()); + JSString* JsData = JS_NewUCStringCopyN(aContext, + data.BeginReading(), + data.Length()); NS_ENSURE_TRUE(JsData, false); v = STRING_TO_JSVAL(JsData); } else if (aData[i].value().type() == BluetoothValue::Tuint32_t) {