#!/usr/local/bin/ruby

=begin
  Ƭ
	img=hoge.jpg
  Ȥѥ󤬤
  <img src="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))/, "<img src=\"\\1\">")
  print (if $euc then line else Kconv::tojis(line) end)
end
