LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
put ""
put "AA" & NumToCodepoint(160) & "BB" into XX
put "1" & tab & XX & tab & "Segments" & tab & the Num of segments of XX & cr after msg
put "1" & tab & XX & tab & "Words" & tab & the Num of words of XX & cr after msg
put "1" & tab & XX & tab & "Chars" & tab & the Num of chars of XX & cr after msg
put "AA" & NumToChar(202) & "BB" into XX -- nbsp MacRoman
put "2" & tab & XX & tab & "Segments" & tab & the Num of segments of XX & cr after msg
put "2" & tab & XX & tab & "Words" & tab & the Num of words of XX & cr after msg
put "2" & tab & XX & tab & "Chars" & tab & the Num of chars of XX & cr after msg
If I type "AA" and an option-space and "BB" I get again 2 words instead of only one.
no idea if this is new in 9.0.4, but it works as expected, the AA BB will WRAP as if it is ONE word.
However LC does treat them as two words.
This is the definition of a word in LC, anything separated by a SPACE, comma etc. and LC does obviously treat a non-breaking space as a space resp. does not differ them
I am usually behind the times with all these new-fangled chunk options in the most recent versions, but anything enclosed in quotes was always one word.
The "trueWord" keyword seems to be the ticket here. It uses the ICU library, not LiveCodes own peccadilloes, as the delimiter between those two strings.
on mouseUp
put "" into fld 1
put "AA BB" into XX
put "1" & tab & XX & tab & "Words" & tab & the Num of words of XX & cr after fld 1
put "1" & tab & XX & tab & "Chars" & tab & the Num of chars of XX & cr after fld 1
put "AA" & NumToChar(202) & "BB" into XX -- nbsp MacRoman
put "2" & tab & XX & tab & "Words" & tab & the Num of words of XX & cr after fld 1
put "2" & tab & XX & tab & "Chars" & tab & the Num of chars of XX & cr after fld 1
end mouseUp
And got:
1 AA BB Words 1
1 AA BB Chars 5
2 AA BB Words 1
2 AA BB Chars 5