Would it be safe to trim leading/trailing whitespace from release titles and artists?

So I’m consuming release data from multiple sources (Musicbrainz, Discogs, Spotify) and I encountered cases where data from e.g. Discogs, had a bogus trailing whitespace at the end of a release title.

I was thinking to put some code in place to automatically strip all trailing and leading whitespace from release titles and artists, whatever the input is (Musicbrainz included). Do you think that’s a safe heuristic to apply, or I could end up messing up legit titles and artist names?

This tag may help


There are some odd names out there. That tag will probably supply some good test data. For example this one will break your idea: Recording “᠍ ᠍ ᠍” by ᠍ ᠍ ᠍ ᠍ - MusicBrainz

Some people just like breaking databases :smiley:


I love xkcd, so funny.