example="blah blah Width = 25.0 �m ..some more stuff";
widthtext=regex(example,"Width\s=\s+\d+[.]\d+\s[\w?�]m");
widthtext=regex(example,"Width\s=\s+\d+[.]\d+\s[\w?\x{FFFD}]m");
Sorry this is less a very specific problem that a general issue I'm looking for recommendations on as I've had this issue in different contexts.
In this specific example I'm using loadtextfile() to get some text that I need to parse and that text can have special characters. here I'm using the variable "example" to show what that looks like to JMP -it has replaced something with a "mystery" symbol. (in case it doesn't continue to show up here it's a black diamond with a question mark in it.) I know that symbol is unicode FFFD (and I know in this case that originally it was a mu, for microns though not sure what particular encoding it had that JMP couldn't work out). I know there are options in the preferences for the charset to use when loading the text file so maybe I could trial and error until this really shows up as a mu. But since my script is looking through a lot of different files I'm not sure I can set a preference that will not have this issue of failing to work out a character and in any case my issue is really with how to talk about any special character in my script, not with having "mystery" instead of mu.
In the example above I pasted in the character as it was shown in the JMP log in order to have it in JSL (second line of code RegEx). That works. contains() works too with the special doodad pasted into it as an argument. But when I save the JSL and reopen it the special character is replaced with ? and the code using the pasted symbol no longer works. seemingly any special characters in JSL are at risk of getting lost.
My third line is fixing that for RegEx. I can call out the character by number so it will run after opening - on a case where instead of hardcoded example I open a text file and have those symbols in there. But what if I want to do any other string things? so far I converted a contains() to a regex() but are there any other ways to use symbols in JSL?
I've had similar issues around greek letters JMP uses in its reports (like a sigma). I want to write code that tests for some text in the report but if I paste in the symbol the JSL will get replaced. These are symbols JMP is choosing and using and yet I can't use them in my JSL robustly.