Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 827 of file id3.c.
{ size_t length = l; size_t i; unsigned char *p; /* determine real length, a latin1 character can at most take 2 in UTF8 */ for(i=0; i<l; ++i) if(s[i] >= 0x80) ++length; debug1("UTF-8 length: %lu", (unsigned long)length); /* one extra zero byte for paranoia */ if(!mpg123_resize_string(sb, length+1)){ mpg123_free_string(sb); return ; } p = (unsigned char*) sb->p; /* Signedness doesn't matter but it shows I thought about the non-issue */ for(i=0; i<l; ++i) if(s[i] < 0x80){ *p = s[i]; ++p; } else /* two-byte encoding */ { *p = 0xc0 | (s[i]>>6); *(p+1) = 0x80 | (s[i] & 0x3f); p+=2; } sb->p[length] = 0; sb->fill = length+1; }