UTF-8 fixes

Fixed an incorrect byte transformation of UTF-8 scripts on 'Show Thumbnails' switching.