@tateisu なるほどそれじゃあmataタグでもう一度文字コードを…と思ったのですがユニコード以外は今は規格外なのかもですね
require "sinatra"
def entity_reference(str, encoding)
str.encode(encoding).codepoints.map{|c| "&##{c};"}.join
end
get "/euc-jp-equiv" do
headers "Content-Type" => "text/html; charset=ISO-8859-1"
<<"_HTML"
<html>
<meta http-equiv="content-type" content="text/html; charset=EUC-JP">
<body><p>#{entity_reference("こんにちは", "EUC-JP")}</p></body>
</html>
_HTML
end