On-Rev: irev to mysql to html charset (apostrophes, etc.) confusion?

2011-10-03 Thread John Patten
Hi All!

I have a LC project that pushes data to a on-rev mysql database. The data saves 
to the mysql  fine, however, apostrophes and other some other punctuation get 
saved as non-english characters. If I request the data from the database via 
my LC project, everything gets pulled back correctly, apostrophes are 
apostrophes, question marks are question marks. However, when I pull the data 
from the database using an .irev script and display as html in web browser, 
apostrophes are not correct (questions marks in black box, or if I change the 
charset in the header of the irev script, a completely different non-english 
character appears.)

How do I get my irev script to save content to database correctly, and get data 
displayed correctly when displaying in html in web browser?

I have messed with changing the charset in header, i.e :

headmeta http-equiv=Content-Type content=text/html; charset=UTF-8 /
/head

...in my irev script, but changing the charset only results in different 
characters. It's almost as if I have not found the correct charset? But yet, if 
my LC project pulls the content from the DB everything appears as it should???

Thanks for any tips!

John Patten
SUSD

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: On-Rev: irev to mysql to html charset (apostrophes, etc.) confusion?

2011-10-03 Thread Bob Sneidar
How are you escaping your sql? Are you using the same method in your web app? 
If you are not, then I think this is probably the issue. I use sqlYoga and if I 
am not mistaken, it has it's own built in escaping. You may want to have a chat 
with Trevor Devore about this sort of thing. 

You may want to check the charset of your sql database itself. If you don't 
ever expect to use a foreign language or exotic characters, then UTF8 should 
work fine. 

Bob


On Oct 3, 2011, at 9:29 AM, John Patten wrote:

 Hi All!
 
 I have a LC project that pushes data to a on-rev mysql database. The data 
 saves to the mysql  fine, however, apostrophes and other some other 
 punctuation get saved as non-english characters. If I request the data from 
 the database via my LC project, everything gets pulled back correctly, 
 apostrophes are apostrophes, question marks are question marks. However, when 
 I pull the data from the database using an .irev script and display as html 
 in web browser, apostrophes are not correct (questions marks in black box, or 
 if I change the charset in the header of the irev script, a completely 
 different non-english character appears.)
 
 How do I get my irev script to save content to database correctly, and get 
 data displayed correctly when displaying in html in web browser?
 
 I have messed with changing the charset in header, i.e :
 
 headmeta http-equiv=Content-Type content=text/html; charset=UTF-8 /
 /head
 
 ...in my irev script, but changing the charset only results in different 
 characters. It's almost as if I have not found the correct charset? But yet, 
 if my LC project pulls the content from the DB everything appears as it 
 should???
 
 Thanks for any tips!
 
 John Patten
 SUSD
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: On-Rev: irev to mysql to html charset (apostrophes, etc.) confusion?

2011-10-03 Thread Pete
In SQLite, the way to escape an apostrophe is to precede it with another
apostrophe, not a backslash.  mySQL allows either method, not sure about
other SQL implementations.
Pete
Molly's Revenge http://www.mollysrevenge.com




On Mon, Oct 3, 2011 at 10:40 AM, Pierre Sahores s...@sahores-conseil.comwrote:


 Le 3 oct. 2011 à 18:42, Bob Sneidar a écrit :

  How are you escaping your sql?

 If not, it needed where it's needed becomes it\'s needed to be stored
 in your SQL backend.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: On-Rev: irev to mysql to html charset (apostrophes, etc.) confusion?

2011-10-03 Thread Kee Nethery
In Sybase and in Python, if you enclose your text statements in double quotes, 
you must escape double quotes inside the text string and don't have to escape 
single quotes. Similarly, if you enclose using single quotes, you must escape 
the single quotes inside the text string and don't have to escape double 
quotes. 

select He's a big deal -- will work fine
select 'He''s a big deal' -- will work fine
select He's a big deal -- will not work because the double quotes in the 
text are not escaped
select 'He's a big deal' -- will not work because the single quote in the 
text is not escaped

I always use single quotes to enclose text and have a routine that escapes them 
for me

function escapeQuote theText
  if ' is in theText then
repeat with x = the number of chars in theText down to 1
  if char x of theText = ' then
put ' before char x of theText
  end if
end repeat
  end if
  return theText
end escapeQuote


Kee Nethery


On Oct 3, 2011, at 5:02 PM, Pete wrote:

 In SQLite, the way to escape an apostrophe is to precede it with another
 apostrophe, not a backslash.  mySQL allows either method, not sure about
 other SQL implementations.
 Pete
 Molly's Revenge http://www.mollysrevenge.com
 
 
 
 
 On Mon, Oct 3, 2011 at 10:40 AM, Pierre Sahores 
 s...@sahores-conseil.comwrote:
 
 
 Le 3 oct. 2011 à 18:42, Bob Sneidar a écrit :
 
 How are you escaping your sql?
 
 If not, it needed where it's needed becomes it\'s needed to be stored
 in your SQL backend.
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode