Posts Tagged ‘unicode’

ruby-mp3info utf-8 support

Wednesday, February 6th, 2008

While apparently there are plans to improve ruby’s support for unicode, the 1.8 stdlib doesn’t make working with encodings transparent. The historically poor support has had its toll on ruby libraries, as I discovered while updating scroball.rb to do the right thing with utf-8.

It led to this patch. On the whole though, it’s of limited use. You don’t see the Id3v2 class from the Mp3Info class, so you don’t get an opportunity to set the encoding up. Even if you did, the implicit assumption that the user deals solely in iso-8559-1 isn’t comforting. Fortunately the characterspace isn’t always truncated into iso-8559-1: strings which fail the iconv transcoding get left alone.

The situation with ruby-mp3info is symptomatic of several legacies: id3v2 and its ad hoc unicode extensions, and second-class support of unicode strings in ruby before 1.9.