Texts are usually returned as 'utf-8', but when they have a BOM they are returned as 'UTF-8'
CharDet.detect("UTF-8¡¡¡") # "encoding"=>"utf-8"
CharDet.detect("\xEF\xBB\xBF BOM¡¡¡") # "encoding"=>"UTF-8"
If it's intentional behaviour, it should be documented.
If not, it should probably return things in a consistent case, but that might be a breaking change.