02-06-2023, 10:25 PM
(This post was last modified: 02-06-2023, 10:26 PM by Tim Curtis.)
@steve4star It looks like you have the Prefs option "UTF8 character filter" enabled. What happens when you turn it off?
The log entry below indicates some sort of problem creating the library cache file. Another oddness is that the file path in the error message is incomplete. It should be something like "/var/local/www/libcache_all.json"
The dev that created the UTF8 filter function several years ago is no longer contributing to moOde so I've listed the function below if anyone has some insights into what it's actually doing.
The log entry below indicates some sort of problem creating the library cache file. Another oddness is that the file path in the error message is incomplete. It should be something like "/var/local/www/libcache_all.json"
Code:
20230206 201147 genLibraryUTF8Rep(): Error: file create failed: /var/local/www/libcache
The dev that created the UTF8 filter function several years ago is no longer contributing to moOde so I've listed the function below if anyone has some insights into what it's actually doing.
Code:
// UTF8 replace (@lazybat)
function utf8rep($str) {
// Reject overly long 2 byte sequences, as well as characters above U+10000 and replace with ? (@lazybat)
$str = preg_replace('/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]'.
'|[\x00-\x7F][\x80-\xBF]+'.
'|([\xC0\xC1]|[\xF0-\xFF])[\x80-\xBF]*'.
'|[\xC2-\xDF]((?![\x80-\xBF])|[\x80-\xBF]{2,})'.
'|[\xE0-\xEF](([\x80-\xBF](?![\x80-\xBF]))|(?![\x80-\xBF]{2})|[\x80-\xBF]{3,})/S',
'--', $str);
// Reject overly long 3 byte sequences and UTF-16 surrogates and replace with ?
$str = preg_replace('/\xE0[\x80-\x9F][\x80-\xBF]'.
'|\xED[\xA0-\xBF][\x80-\xBF]/S','--', $str);
return $str;
}