Backwords compatibility for ruby below 1.9
Escape, not encode.
fixed merge