diff --git a/extra/id3/id3.factor b/extra/id3/id3.factor index fba6188b1e..a4adeedaa5 100644 --- a/extra/id3/id3.factor +++ b/extra/id3/id3.factor @@ -3,9 +3,9 @@ USING: sequences io io.encodings.binary io.files io.pathnames strings kernel math io.mmap io.mmap.uchar accessors syntax combinators math.ranges unicode.categories byte-arrays -io.encodings.string io.encodings.utf8 assocs math.parser +io.encodings.string io.encodings.utf16 assocs math.parser combinators.short-circuit fry namespaces multiline -combinators.smart splitting ; +combinators.smart splitting io.encodings.ascii ; IN: id3 ] dip { - [ read-frame-id utf8 decode >>frame-id ] - [ read-frame-flags >byte-array >>flags ] - [ read-frame-size >28bitword >>size ] - [ read-frame-data utf8 decode >>data ] + [ read-frame-id decode-text >>frame-id ] + [ read-frame-flags >byte-array >>flags ] + [ read-frame-size >28bitword >>size ] + [ read-frame-data decode-text >>data ] } cleave ; : read-frame ( mmap -- frame/f ) @@ -270,12 +275,12 @@ TUPLE: id3-info title artist album year comment genre ; : (read-v1-tag-data) ( seq -- mp3-file ) [ ] dip { - [ read-title utf8 decode filter-text-data >>title ] - [ read-artist utf8 decode filter-text-data >>artist ] - [ read-album utf8 decode filter-text-data >>album ] - [ read-year utf8 decode filter-text-data >>year ] - [ read-comment utf8 decode filter-text-data >>comment ] - [ read-genre number>string >>genre ] + [ read-title decode-text filter-text-data >>title ] + [ read-artist decode-text filter-text-data >>artist ] + [ read-album decode-text filter-text-data >>album ] + [ read-year decode-text filter-text-data >>year ] + [ read-comment decode-text filter-text-data >>comment ] + [ read-genre number>string >>genre ] } cleave ; inline : read-v1-tag-data ( seq -- mp3-file )