patch-src_io_helpers_cpp 787 B

1234567891011121314151617181920
  1. $OpenBSD: patch-src_io_helpers_cpp,v 1.1 2007/05/20 13:02:16 bernd Exp $
  2. * Patch from Spoon to fix UTF-16 writing bug
  3. http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
  4. --- src/io_helpers.cpp.orig Sun Mar 2 01:23:00 2003
  5. +++ src/io_helpers.cpp Wed May 16 23:09:58 2007
  6. @@ -363,9 +363,10 @@ size_t io::writeUnicodeText(ID3_Writer& writer, String
  7. // Write the BOM: 0xFEFF
  8. unicode_t BOM = 0xFEFF;
  9. writer.writeChars((const unsigned char*) &BOM, 2);
  10. + unsigned char *pdata = (unsigned char *) data.c_str();
  11. for (size_t i = 0; i < size; i += 2)
  12. {
  13. - unicode_t ch = (data[i] << 8) | data[i+1];
  14. + unicode_t ch = (pdata[i] << 8) | pdata[i+1];
  15. writer.writeChars((const unsigned char*) &ch, 2);
  16. }
  17. }