Warning, /multimedia/kid3/packaging/patches/id3lib-3.8.3-30-fix-utf16.patch is written in an unsupported language. File is not indexed.

0001 Patch from 'Spoon' to fix issues with writing certain unicode characters
0002 --- a/ChangeLog
0003 +++ b/ChangeLog
0004 @@ -1,3 +1,8 @@
0005 +2006-02-17  Jerome Couderc
0006 +
0007 +    * Patch from Spoon to fix UTF-16 writing bug
0008 +      http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
0009 +
0010  2003-03-02 Sunday 17:38   Thijmen Klok <thijmen@id3lib.org>
0011  
0012         * THANKS (1.20): added more people 
0013 --- a/src/io_helpers.cpp
0014 +++ b/src/io_helpers.cpp
0015 @@ -363,11 +363,22 @@
0016      // Write the BOM: 0xFEFF
0017      unicode_t BOM = 0xFEFF;
0018      writer.writeChars((const unsigned char*) &BOM, 2);
0019 +    // Patch from Spoon : 2004-08-25 14:17
0020 +    //   http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
0021 +    // Wrong code
0022 +    //for (size_t i = 0; i < size; i += 2)
0023 +    //{
0024 +    //  unicode_t ch = (data[i] << 8) | data[i+1];
0025 +    //  writer.writeChars((const unsigned char*) &ch, 2);
0026 +    //}
0027 +    // Right code
0028 +    unsigned char *pdata = (unsigned char *) data.c_str();
0029      for (size_t i = 0; i < size; i += 2)
0030      {
0031 -      unicode_t ch = (data[i] << 8) | data[i+1];
0032 +      unicode_t ch = (pdata[i] << 8) | pdata[i+1];
0033        writer.writeChars((const unsigned char*) &ch, 2);
0034      }
0035 +    // End patch
0036    }
0037    return writer.getCur() - beg;
0038  }