Charset cs = FileUtil.UTF8();
FileOutputStream fout = new FileOutputStream(target);
OutputStreamWriter strW = new OutputStreamWriter(fout, cs);
IndentStackWriter writer = new IndentStackWriter(strW);
HashMap<String,String> t = new HashMap<String, String>();
writer.push();
for(Map.Entry<String,String> kv : props.entrySet()){
t.put( "key", TextUtil.htmlEncode(kv.getKey()) );
t.put( "value", TextUtil.htmlEncode(kv.getValue()) );
writer.println(TextUtil.template(metaTmpl, t));
}
String htmlMeta = writer.pop();
t.putAll(props);
t.put("htmlMeta", htmlMeta);
t.put("htmlBody", htmlBody);
t.put("charset", cs.name());
writer.println(TextUtil.template(htmlTmpl, t));
writer.flush();
strW.flush();
fout.flush();
fout.close();
}catch(Throwable e){