diff -ruN id3lib-3.8.3.orig/ChangeLog id3lib-3.8.3/ChangeLog
old
|
new
|
|
| 1 | 2006-02-17 Jerome Couderc |
| 2 | |
| 3 | * Patch from Spoon to fix UTF-16 writing bug |
| 4 | http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979 |
| 5 | |
1 | 6 | 2003-03-02 Sunday 17:38 Thijmen Klok <thijmen@id3lib.org> |
2 | 7 | |
3 | 8 | * THANKS (1.20): added more people |
diff -ruN id3lib-3.8.3.orig/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
old
|
new
|
|
363 | 363 | // Write the BOM: 0xFEFF |
364 | 364 | unicode_t BOM = 0xFEFF; |
365 | 365 | writer.writeChars((const unsigned char*) &BOM, 2); |
| 366 | // Patch from Spoon : 2004-08-25 14:17 |
| 367 | // http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979 |
| 368 | // Wrong code |
| 369 | //for (size_t i = 0; i < size; i += 2) |
| 370 | //{ |
| 371 | // unicode_t ch = (data[i] << 8) | data[i+1]; |
| 372 | // writer.writeChars((const unsigned char*) &ch, 2); |
| 373 | //} |
| 374 | // Right code |
| 375 | unsigned char *pdata = (unsigned char *) data.c_str(); |
366 | 376 | for (size_t i = 0; i < size; i += 2) |
367 | 377 | { |
368 | | unicode_t ch = (data[i] << 8) | data[i+1]; |
| 378 | unicode_t ch = (pdata[i] << 8) | pdata[i+1]; |
369 | 379 | writer.writeChars((const unsigned char*) &ch, 2); |
370 | 380 | } |
| 381 | // End patch |
371 | 382 | } |
372 | 383 | return writer.getCur() - beg; |
373 | 384 | } |