It seems that you read too fast.
is not part of the conversion code.
I just used it to build the text to convert because I was too lazy to type it with the characters enocded in the range 65296 to 65375 and was not sure of the way it would be treated in a mail.
The conversion code itself doesn't use the id property.
Here I built a synthesis showing how we may treat the ß problem with the three schemes which from my point of view are acceptable.
set texte to "Hello happy tax payers"
set texte2 to ""
repeat with unCarac in text of texte
set unID to id of unCarac -- used only to build the source string !
if (unID > 47) and unID < 127 then
set texte2 to texte2 & character id (65296 - 48 + unID)
else
set texte2 to texte2 & unCarac
end if
end repeat
set texte3 to texte2 & "ß üийӑⓔ𝓰𝓲"
my changeCase(texte3, "upper")
--=====
(*
Le second argument peut être: "upper", "lower"
*)
on changeCase(txt, mode, whichWay)
(*
whichWay = 1 --> use ASObjC Runner
whichWay = 2 --> use Python
whichWay = 3 --> use Satimage
*)
if whichWay = 1 then
script capNStuff
set x to current application's NSApp's convertedValue()
set x to x's componentsSeparatedByString_(":")
set x to x's componentsJoinedByString_("")
set x to x's uppercaseString()
end script
script lowNStuff
set x to current application's NSApp's convertedValue()
set x to x's componentsSeparatedByString_(":")
set x to x's componentsJoinedByString_("")
set x to x's lowercaseString()
end script
if mode is "upper" then
if txt contains "ß" then
(*
Required to convert ß if we don’t want to get SS *)
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to "ß"
set l to text items of txt
set AppleScript's text item delimiters to character id 7838
set txt to "" & l
set AppleScript's text item delimiters to oTIDs
end if
tell application "ASObjC Runner" to set txt to (run the script {capNStuff} converting txt with result returned)
else if mode is "lower" then
tell application "ASObjC Runner" to set txt to (run the script {lowNStuff} converting txt with result returned)
end if
else if whichWay = 2 then
(*
using Python *)
if mode is "upper" and txt contains "ß" then
(*
Required to convert ß which isn’t treated by Python itself *)
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to "ß"
set l to text items of txt
set AppleScript's text item delimiters to character id 7838 -- or "SS"
set txt to "" & l
set AppleScript's text item delimiters to oTIDs
end if
set python_script to "import sys; print sys.argv[1].decode('utf8')." & mode & "().encode('utf8')"
set txt to do shell script "/usr/bin/python -c " & quoted form of python_script & " " & quoted form of txt
else if whichWay = 3 then
(*
Using Satimage *)
if mode is "upper" then
if txt contains "ß" then
(*
Required to convert ß if we don’t want to get SS *)
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to "ß"
set l to text items of txt
set AppleScript's text item delimiters to character id 7838
set txt to "" & l
set AppleScript's text item delimiters to oTIDs
end if
set txt to uppercase txt
else if mode is "lower" then
set txt to lowercase txt
end if
end if
return txt
end changeCase
--=====
But of course if you think that only less than 150 characters are important, you may stay sticked to plain vanilla code.
I just wonder why so many brains worked hard to build Unicode if only these 150 chars are important.