work-around android bug.

This commit is contained in:
Vítor Santos Costa 2014-05-04 22:29:23 +01:00
parent 6738682c26
commit f8ab2d093e
1 changed files with 12 additions and 2 deletions

View File

@ -717,12 +717,21 @@ represented.
static int
wctobuffer(wchar_t c, mbstate_t *mbs, Buffer buf)
{ char b[PL_MB_LEN_MAX];
{
#if __ANDROID__
// wcrtomb & friends seems broken in android, just copy
if ( c < 256 ) {
addBuffer(buf, c, char);
return TRUE;
} else {
return FALSE;
}
#else
char b[PL_MB_LEN_MAX];
size_t n;
if ( (n=wcrtomb(b, c, mbs)) != (size_t)-1 )
{ size_t i;
for(i=0; i<n; i++)
addBuffer(buf, b[i], char);
@ -730,6 +739,7 @@ wctobuffer(wchar_t c, mbstate_t *mbs, Buffer buf)
}
return FALSE; /* cannot represent */
#endif
}