File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -466,10 +466,17 @@ protected void Parse (ByteVector data, int offset)
466
466
467
467
Size = pos + 1 + ( int ) value_length - offset ;
468
468
469
- if ( Type == ItemType . Binary )
470
- this . data = new ReadOnlyByteVector ( data . Mid ( pos + 1 , ( int ) value_length ) ) ;
471
- else
472
- text = data . Mid ( pos + 1 , ( int ) value_length ) . ToStrings ( StringType . UTF8 , 0 ) ;
469
+ // Store both the binary and string representation, because APE v1. tags don't use the flags.
470
+ // Because of this the parser can't differentiate between string and binary.
471
+ // In this case sting is assumed (because flags == 0).
472
+ //
473
+ // If we write both string and binary data, the application can still access the binary data by setting the Type to binary.
474
+
475
+ // Binary representation
476
+ this . data = new ReadOnlyByteVector ( data . Mid ( pos + 1 , ( int ) value_length ) ) ;
477
+
478
+ // String representation
479
+ text = data . Mid ( pos + 1 , ( int ) value_length ) . ToStrings ( StringType . UTF8 , 0 ) ;
473
480
}
474
481
475
482
#endregion
You can’t perform that action at this time.
0 commit comments