I was recently looking at the now LiveCode stack that contains this function, in order to modify the old textual entities into numeric ones. The function is:
Code: Select all
function textToEntities textToCheck
put "&,ä,á,à,â,ã,å,æ,ë,è,é,ê,í,ï,î,ñ,ö,ó,ò,ô,õ,ü,ú,ù,ç,Å,Æ,Ö,Ü,…,—,£,¡,ß" into textTable
put "&,ä,á,à,â,ã,å,æ,ë,è,é,ê,í,ï,î,ñ,ö,ó,ò,ô,õ,ü,ú,ù,ç,Å,Æ,Ö,Ü,…,—,£,¡,ß" into entityTable
put 0 into itemCount
repeat for each item textTableItem in textTable
get textTableItem
add 1 to itemCount
replace it with item itemCount of entityTable in textToCheck
end repeat
return textToCheck
end textToEntities