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

void id3_to_utf8 ( mpg123_string sb,
unsigned char  encoding,
const unsigned char source,
size_t  source_size,
int  noquiet 
)

Definition at line 219 of file id3.c.

Referenced by mpg123_store_utf8(), and store_id3_text().

{
    unsigned int bwidth;
    debug1("encoding: %u", encoding);
    /* A note: ID3v2.3 uses UCS-2 non-variable 16bit encoding, v2.4 uses UTF16.
       UTF-16 uses a reserved/private range in UCS-2 to add the magic, so we just always treat it as UTF. */
    if(encoding > mpg123_id3_enc_max)
    {
        if(noquiet) error1("Unknown text encoding %u, I take no chances, sorry!", encoding);

        mpg123_free_string(sb);
        return;
    }
    bwidth = encoding_widths[encoding];
    /* Hack! I've seen a stray zero byte before BOM. Is that supposed to happen? */
    if(encoding != mpg123_id3_utf16be) /* UTF16be _can_ beging with a null byte! */
    while(source_size > bwidth && source[0] == 0)
    {
        --source_size;
        ++source;
        debug("skipped leading zero");
    }
    if(source_size % bwidth)
    {
        /* When we need two bytes for a character, it's strange to have an uneven bytestream length. */
        if(noquiet) warning2("Weird tag size %d for encoding %u - I will probably trim too early or something but I think the MP3 is broken.", (int)source_size, encoding);
        source_size -= source_size % bwidth;
    }
    text_converters[encoding](sb, source, source_size, noquiet);
}

Generated on Fri May 25 2012 05:54:51 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.