CodeRay is smart enough to discover the correct source encoding. so wrap normal text in CodeRay's scan method before passing it to ERB::Util.html_escape