muennich/id3ted — pull request #10 by Tatsh (2014-11-30 00:02:08+00:00)
Title: Only output valid ISO-639-2 language codes, issue #9

This just adds a simple length check to ensure validity of the language code (but does not validate the code itself). The standard says it should always be ISO-639-2 which are always 3 characters long. The printing of `lyrics->language().data()` is not bounded, therefore unpredictable, and can easily corrupt a terminal due to junk bytes at the end of that point in memory. If we are lucky we get junk bytes starting with `\x00` but this is not the case most of time as I showed in issue #9.

This does not fully solve #9 completely as invalid data can still be printed (if encoded in the file by hand), but if tags are done properly with id3ted itself, e.g.:

```bash
id3ted --USLT "$(< lyrics):description text:eng" the.mp3
```

`eng` should always be printed without extra bytes from the `TByteVector::data()` method. This should fix most issues regarding outputting fully compliant UTF-8 with the `--list` argument and other features.