based on http://hp.vector.co.jp/authors/VA005784/cobuild/cobuildconv.html