mirror of https://github.com/axmolengine/axmol.git
Merge pull request #2386 from dumganhar/master
fixed #2059: Fix complication errors on Android.
This commit is contained in:
commit
62f3528282
|
@ -275,7 +275,7 @@ cc_utf8_get_char (const char * p)
|
|||
}
|
||||
|
||||
|
||||
unsigned short* cc_utf8_to_utf16(const char* str_old, size_t length/* = -1 */, size_t* rUtf16Size/* = NULL */)
|
||||
unsigned short* cc_utf8_to_utf16(const char* str_old, int length/* = -1 */, int* rUtf16Size/* = NULL */)
|
||||
{
|
||||
int len = cc_utf8_strlen(str_old, length);
|
||||
if (rUtf16Size != NULL) {
|
||||
|
|
|
@ -59,7 +59,7 @@ CC_DLL std::vector<unsigned short> cc_utf16_vec_from_utf16_str(const unsigned sh
|
|||
*
|
||||
* Return value: the newly created utf8 string.
|
||||
* */
|
||||
CC_DLL unsigned short* cc_utf8_to_utf16(const char* str_old, size_t length = -1, size_t* rUtf16Size = NULL);
|
||||
CC_DLL unsigned short* cc_utf8_to_utf16(const char* str_old, int length = -1, int* rUtf16Size = NULL);
|
||||
|
||||
/**
|
||||
* cc_utf16_to_utf8:
|
||||
|
|
|
@ -1530,7 +1530,7 @@ jsval c_string_to_jsval(JSContext* cx, const char* v, size_t length /* = -1 */)
|
|||
return JSVAL_NULL;
|
||||
}
|
||||
jsval ret = JSVAL_NULL;
|
||||
size_t utf16_size = 0;
|
||||
int utf16_size = 0;
|
||||
jschar* strUTF16 = (jschar*)cc_utf8_to_utf16(v, length, &utf16_size);
|
||||
|
||||
if (strUTF16 && utf16_size > 0) {
|
||||
|
|
Loading…
Reference in New Issue