About emoji in JSB

in C++
CCLabelTTF->setString( CCEditbox->getText() )
it can show emoji current

In JSB
cc.LabelTTF.setString(editbox.getText());
it show emoji no current

ScriptingCore.cpp

jsval c_string_to_jsval(JSContext* cx, const char* v, size_t length /* = -1 */) {
    if (v == NULL) {
        return JSVAL_NULL;
    }
    jsval ret = JSVAL_NULL;
    int utf16_size = 0;
   //--------------- I think because of problems caused by this method  cc_utf-8_to_utf16 
    jschar* strUTF16 = (jschar*)cc_utf8_to_utf16(v, length, &utf16_size);

    if (strUTF16 && utf16_size > 0) {
        JSString* str = JS_NewUCStringCopyN(cx, strUTF16, utf16_size);
        if (str) {
            ret = STRING_TO_JSVAL(str);
        }
        delete[] strUTF16;
    }
    return ret;
}

Could you make a demo for us to debug this issue? Thanks.

In TestCpp.xcodeproj
EditBoxTest.cpp

void EditBoxTest::editBoxReturn(CCEditBox* editBox)
{
    CCLog("editBox %p was returned !",editBox);

    if (m_pEditName == editBox)
    {
        m_pTTFShowEditReturn->setString(editBox->getText());
    }
    else if (m_pEditPassword == editBox)
    {
        m_pTTFShowEditReturn->setString("Password EditBox return !"); 
    }
    else if (m_pEditEmail == editBox)
    {
       // i change this line..
        m_pTTFShowEditReturn->setString(editBox->getText());
    }
}

Now type emoji in editbox and return … see photo 1

    editBoxReturn: function (editBox) {
        cc.log("editBox " + this._getEditBoxName(editBox) + " was returned !");
        this.label.setString(editBox.getText());
    },

The same operation in JSB and see photo 2

Hi, it’s mainly because the text is set to Black color. Please use white color if you want to use emoji. Thanks.

James Chen wrote:

Hi, it’s mainly because the text is set to Black color. Please use white color if you want to use emoji. Thanks.

i mean the emoji can not show when editbox.getText() set to labelTTF.setString()
But C++ is right

Haibo Lin wrote:

James Chen wrote:
> Hi, it’s mainly because the text is set to Black color. Please use white color if you want to use emoji. Thanks.
>
i mean the emoji can not show when editbox.getText() set to labelTTF.setString()
But C++ is right

Yes, I found the same problem here now. Did you solved this?