Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null value separator reading doesn't work properly #82

Closed
Marekkon5 opened this issue Apr 27, 2022 · 0 comments
Closed

null value separator reading doesn't work properly #82

Marekkon5 opened this issue Apr 27, 2022 · 0 comments
Labels

Comments

@Marekkon5
Copy link
Contributor

Hello, if I use a null (\0) separator for my values, then save and load again, the read frame only has the first value.
Example / test:

#[test]
fn test_null() {
    let mut tag = Tag::new();
    tag.add_frame(Frame::text("TPE1", "artist 1\0artist 2\0artist 3"));
    let mut buf = vec![];
    tag.write_to(std::io::Cursor::new(&mut buf), Version::Id3v23).unwrap();
    let tag = Tag::read_from(&buf[..]).unwrap();
    assert_eq!(tag.text_for_frame_id("TPE1").unwrap(), "artist 1\0artist 2\0artist 3");
}

Result:

left: `"artist 1"`,
right: `"artist 1\u{0}artist 2\u{0}artist 3"`'

Thanks

@polyfloyd polyfloyd added the bug label Apr 30, 2022
martpie pushed a commit to martpie/rust-id3 that referenced this issue May 25, 2022
Null bytes in text frames is an ID3v2.4 feature. A valid substitute is
to use '/' in prior versions. This was always the intended behaviour,
hence this is considered a bug fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants