Comment #13 on issue 761 by [email protected]: Incorrect UTF-8 encoding/decoding for non-BMP characters in String related functions
http://code.google.com/p/v8/issues/detail?id=761

Hi,
I need to send some data from native application to browser Java script apps though websocket which contain non-BMP Character e.g. (𝍖) U+1D356 in UTF-8=(f0 9d 8d 96) in UTF-16=(\uD834\uDF56) (Refrence:http://graphemica.com/%F0%9D%8D%96)

   I have tried follwing methods

Way 1:

   char str[9];
   char *p = out;
        *p++ = '\\';
        *p++ = 'u';
        *p++ = 0xd8;
        *p++ = 0x34;
        *p++ = '\\';
        *p++ = 'u';
        *p++ = 0xdf;
        *p++ = 0x56;
        *p = '\0';
        
send this str over websocket but in application it not able to parse showing NaN Error
        
Way 2:  
        printf(str,"\\u%x\\u%x", 0xD7C0 + (c >> 10), 0xDC00 | c & 0x3FF);

send this str over websocket but in chrome application it display \ud834\udf56 and not able to render as a unicode character.
        
Please suggest


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to