Created
July 9, 2011 11:21
-
-
Save aont/1073526 to your computer and use it in GitHub Desktop.
id3lib-ruby utf16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'id3lib' | |
require "kconv" | |
class MyID3Tag < ID3Lib::Tag | |
def title=(v) | |
self.set_frame_text(:TIT2, v.toutf16) | |
self.frame(:TIT2)[:textenc] = 1 | |
end | |
def album=(v) | |
self.set_frame_text(:TALB, v.toutf16) | |
self.frame(:TALB)[:textenc] = 1 | |
end | |
def artist=(v) | |
self.set_frame_text(:TPE1, v.toutf16) | |
self.frame(:TPE1)[:textenc] = 1 | |
end | |
end | |
tag = MyID3Tag.new('orig.mp3', ID3Lib::V_ALL) | |
tag.title = "たいとる" | |
tag.album="あるばむ" | |
tag.artist="あーちすと" | |
tag.track = '5/13' | |
tag.update! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment