Markup_get was misbehaving and returning wrong results with some escaped chars. markup_to_utf8 was working correctly. Merged the code together and now both are consistent and correct. Thanks to WooHyun for reporting.