#!/usr/local/bin/ruby
=begin
行頭に
img=hoge.jpg
というパターンがあれば
に置換する。
=end
require 'kconv'
$euc = false
while /^-\w/ =~ ARGV[0]
case ARGV[0]
when /^-e$/
$euc=true;
end
ARGV.shift
end
$euc = true if /euc|-e$/ =~ $0
while line=gets
line = Kconv::toeuc(line)
line.gsub!(/^img=([0-z]+\.(jpg|png))/, "")
print (if $euc then line else Kconv::tojis(line) end)
end