Good afternoon all,
Firstly, grab a cuppa, because this might be a long one!
I had written an application on 10.5.x Intel and built it so it would run on 10.4 and 10.5, PPC and Intel. I’ll hang my head in shame and say I did not test the app on 10.4 prior to sending it to someone, and not surprisingly, they’ve found and issue on 10.4. When I run the application on 10.4, I also see the issue.
Basically the app will read a file, allow you to edit or add some options depending on what was read from the file, then write the data back to the file.
The issue was that you would run the app, edit an option, save the change, quit the app and relaunch it and the option had not been saved. Looking deeper into the issue it appears that when saving, bizarre characters are being written between every character. I did not spot this as first as I was viewing the file in TextEdit and it did not show the odd characters, however, once I opened the file in BBEdit, or Pico, I could see these characters. This obviously explains why the app was reverting back the option, as I’m looking for a specific string when iterating through the data in the file, and I’m not finding that string due to the characters being added.
As for the characters, in BBEdit’s find dialog they are displayed as “\x00” (without the double quotes around them).
This is obviously weird to say the least. Anyway, I copy my project onto a PPC 10.4 machine (iBook) and open it up. I edit the script and it won’t compile. I see a syntax error dialog stating Expected “then”, etc. but found unknown token. I look at the line in question and it is as follows:
if refnum ,â 0 then close access refnum
This is, obviously, incorrect. It should be:
if refnum ≠0 then close access refnum
So I change it, try to compile, I get the same error, but a different location, however it’s the same issue. The line of code should have a ≠symbol but it’s ,â instead. As I correct this and move on, I find other symbols or characters are not what they should be. ≥ isn’t as it should be, nor are « and »
Once I’ve corrected them all, and then build on the 10.4 machine, the application appears to work without issue, and it’s not adding bizarre characters to the file it’s writing.
Phew. Still here?
Now for my question. What on earth is happening with the symbols/characters getting messed up? In some places, where I’m specifying « and » in a string I could use (ascii character 199) and (ascii character 200) instead, however, the real question is with the ≥ and ≠symbols. What do I replace those with? More specifically, is the textual expression of, for example “is not equal to” the same as ≠? What about ≥ is the textual equivalent “is greater than or equal to”?
This is obviously important as I’m using the symbols to check the value of items and thus if I cannot use the symbol, I must use the correct textual version, or recode things to avoid using the symbols if possible.
Thanks in advance for any advice/comments/suggestions.