Fix unicode problem with Text preview backend

please review