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
require 'open-uri' | |
require 'json' | |
response = open('http://www.idolfes.com/2016/json/timetable/time.json') | |
data = JSON.parse(response.read) | |
artists = {} | |
data.each do |day, stages| | |
stages.each do |stage, items| | |
items.each do |item| |
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
require 'kconv' | |
require 'iconv' | |
require 'nkf' | |
require 'test/unit' | |
class GuessEncoding < Test::Unit::TestCase | |
def setup | |
# EUC-JP encoded うまく表示してね! | |
@euc = "¥345¥341¥254¥345¥242¥300¥345¥341¥276¥352¥241¥243¥245¥243¥356¥246¥245¥263¥345¥341¥316¥345¥242¥250¥345¥341¥245¥345¥376¥276" | |
end |
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
require 'kconv' | |
require 'iconv' | |
require 'nkf' | |
require 'test/unit' | |
class GuessEncoding < Test::Unit::TestCase | |
def setup | |
@euc = "うまく表示してね!".kconv(Kconv::EUC, Kconv::SJIS) | |
end | |