ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static void convert_latin1 ( mpg123_string sb,
const unsigned char source,
size_t  len,
const int  noquiet 
) [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;
}

Generated on Fri May 25 2012 05:58:53 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.