Constant Editor Single Quote used in MySQL

On my Mac (Yosemite) when I type a single quote (ASCII decimal 39) I get a different single quote. It appears to be a unicode character possibly hex 18 20. It is what I have heard referred to as a back-tic.

This quote is not recognized as a valid single quote if I use it in a MySQL query. To make things work I use a MySQL client to build the query then copy and paste it into the constant editor. If I go back to make a tweak in the query I have to be very careful or the XOJO constant editor will add some unicode stuff for me.

Is this a bug or the intended function? I think it began working this way in the last few versions of XOJO but I am not sure when.

Is there an easy way around it?

In your System Preferences select “Keyboard”
Uncheck the “Use smart quotes and dashes”

Note that this will disable these smart quotes system wide, not just Xojo.

Check in the System Preferences >> Keyboard >> Text and remove any replacement you don’t need.
You may also try to Control-click in the constant editor, select ‘Substitutions’ >nd uncheck the ‘Smart quotes’ item.

Yep that fixed it.

It must have been the Yosemite upgrade that changed a preference. I guess the MySQL client is smart enough to take care of the problem. I generally build queries that way anyway to get them working then copy/paste them into XOJO. It was when I needed to make a minor adjustment using the XOJO constant editor that apparently OS X tried to “help”.

Thanks!

Mark - as a Xojo Pro I’m sure you know this, but for the benefit of people learning there’s a good thread here about the use of single quotes, double quotes and backticks in MySQL http://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks