Improved preventUnicode caching.