You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::path::Path;use lofty::config::{ParseOptions,ParsingMode};use lofty::file::{AudioFile,TaggedFileExt};use lofty::probe::Probe;use lofty::tag::Accessor;fnmain(){// the error seems to occur with strict or relaxed parsing modelet parsing_options = ParseOptions::new().parsing_mode(ParsingMode::Relaxed);let path = Path::new("sample.mp3");let file = Probe::open(&path).expect("can't probe").options(parsing_options).read().expect("can't read");let tag = file.primary_tag().expect("no tag");let properties = file.properties();println!("{:?}", tag.artist());println!("{:?}", tag.year());}
Summary
This results in this panic:
thread 'main' panicked at src/main.rs:16:10:
can't read: TextDecode("UTF-16 string has an odd length")
Expected behavior
ffprobe and id3info both seem to be able to read this sample file ok. Are they just falling back to some kind of best-effort conversion for badly encoded UTF-16 strings perhaps?
Reproducer
I tried this code:
Summary
This results in this panic:
Expected behavior
ffprobe and id3info both seem to be able to read this sample file ok. Are they just falling back to some kind of best-effort conversion for badly encoded UTF-16 strings perhaps?
Assets
sample.mp3.zip
The text was updated successfully, but these errors were encountered: