Skip to main content

normalize_filename

Function normalize_filename 

Source
pub fn normalize_filename(name: &str) -> String
Expand description

A name made safe as a file name: accents stripped, anything else outside ASCII dropped, and what is not a letter, a digit, _ or - made _, all but a four-character extension: music21’s normalizeFilename.

use music21::common::stringtools::normalize_filename;

assert_eq!(
    normalize_filename("03-Niccolò all’lessandra.not really.xml"),
    "03-Niccolo_all_lessandra_not_really.xml"
);