On 2007-11-20, at 22:55, Skeeve wrote:
set elan to "élAn"
set upper to (do shell script "echo 'puts [string toupper {" & elan & "}]' | tclsh")
set lower to (do shell script "echo 'puts [string tolower {" & upper & "}]' | tclsh")
set title to (do shell script "echo 'puts [string totitle {" & upper & "}]' | tclsh")
set res to upper & space & lower & space & title
Fails with (e.g.)
set elan to "it's flaws are obviouse ;-)"
Sharp as a tack. Try this form instead:
--set elan to quoted form of "élAn"
set elan to quoted form of "it's flaws are obviouse ;-)"
set upper to (do shell script "tclsh <<< 'puts [string toupper {'" & elan & "'}]'")
set lower to (do shell script "tclsh <<< 'puts [string tolower {'" & elan & "'}]'")
set title to (do shell script "tclsh <<< 'puts [string totitle {'" & elan & "'}]'")
upper & space & lower & space & title
I'm still concerned about it working on Takaaki's Japanese system.
The robust solution might have to be:
quoted form of ("some string" as «class utf8»)
Philip Aker