Re: -- SOLVED -- [WebDNA] encoding with webdna/JS, in context of various file encodings/charsets

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 105790
interpreted = N
texte = --Apple-Mail-12-902953474 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Tom, thank you for your time. You were right.. that was it; I was using a less-than-current JS escaping function. This page gives a more precise comparison of the JS escaping functions: http://xkr.us/articles/javascript/encode-compare/ Now I have them straight enough to remember this time. ( I sw Sorry for the noise on this list.. but with any luck, it will save some of the newer JS/AJAX/WebDNA'ers some time. Christer, thanks so much for your offer.. I think I am all set for now. -Govinda On Sep 10, 2010, at 11:22 AM, Tom Duke wrote: > Govinda, > > OK - your page, and the ajax page are being served as UTF-8 - but > the post to the db is incorrect. It is encoding the pound symbol as: > > %27%A3 > > whereas it should be > > %C2%A3 > > I'm no javascript expert but it looks like you shouldn't be using > 'escape()' on unicode characters: > > http://www.dangrossman.info/2007/05/25/handling-utf-8-in-javascript-php-and-non-utf8-databases/ > > the guy on the link above suggests using > 'encodeURIComponent(string)'. Would you not consider building > your ajax stuff using the Jquery framework - that's my plan when I > get the time to sort it. > > - Tom > > ------------ Govinda govinda.webdnatalk@gmail.com --Apple-Mail-12-902953474 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Tom, 
thank you for = your time.  You were right.. that was it; I was using a = less-than-current JS escaping function.
This page gives a more = precise comparison of the JS escaping functions:
http://xkr.us/a= rticles/javascript/encode-compare/
Now I have them = straight enough to remember this time.  ( I = sw

Sorry for the noise on this list.. but with = any luck, it will save some of the newer JS/AJAX/WebDNA'ers some = time.

Christer, thanks so much for your offer.. = I think I am all set for = now.

-Govinda


<= div>On Sep 10, 2010, at 11:22 AM, Tom Duke wrote:

Govinda,

OK - = your page, and the ajax page are being served as UTF-8 - but the post to = the db is incorrect.   It is encoding the pound symbol as: =

   = %27%A3

whereas = it should be

   %C2%A3

I'm no javascript expert but it = looks like you shouldn't be using 'escape()' on unicode = characters:

    http://www.dangrossman.info/2007/05/25/hand= ling-utf-8-in-javascript-php-and-non-utf8-databases/
=

the guy on the link above suggests = using 'encodeURIComponent(string)'.    Would you not = consider building your ajax stuff using the Jquery framework - that's my = plan when I get the time to sort it.

- Tom
=


=



=

= --Apple-Mail-12-902953474-- Associated Messages, from the most recent to the oldest:

    
  1. Re: -- SOLVED -- [WebDNA] encoding with webdna/JS, in context of various file encodings/charsets (Govinda 2010)
--Apple-Mail-12-902953474 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Tom, thank you for your time. You were right.. that was it; I was using a less-than-current JS escaping function. This page gives a more precise comparison of the JS escaping functions: http://xkr.us/articles/javascript/encode-compare/ Now I have them straight enough to remember this time. ( I sw Sorry for the noise on this list.. but with any luck, it will save some of the newer JS/AJAX/WebDNA'ers some time. Christer, thanks so much for your offer.. I think I am all set for now. -Govinda On Sep 10, 2010, at 11:22 AM, Tom Duke wrote: > Govinda, > > OK - your page, and the ajax page are being served as UTF-8 - but > the post to the db is incorrect. It is encoding the pound symbol as: > > %27%A3 > > whereas it should be > > %C2%A3 > > I'm no javascript expert but it looks like you shouldn't be using > 'escape()' on unicode characters: > > http://www.dangrossman.info/2007/05/25/handling-utf-8-in-javascript-php-and-non-utf8-databases/ > > the guy on the link above suggests using > 'encodeURIComponent(string)'. Would you not consider building > your ajax stuff using the Jquery framework - that's my plan when I > get the time to sort it. > > - Tom > > ------------ Govinda govinda.webdnatalk@gmail.com --Apple-Mail-12-902953474 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Tom, 
thank you for = your time.  You were right.. that was it; I was using a = less-than-current JS escaping function.
This page gives a more = precise comparison of the JS escaping functions:
http://xkr.us/a= rticles/javascript/encode-compare/
Now I have them = straight enough to remember this time.  ( I = sw

Sorry for the noise on this list.. but with = any luck, it will save some of the newer JS/AJAX/WebDNA'ers some = time.

Christer, thanks so much for your offer.. = I think I am all set for = now.

-Govinda


<= div>On Sep 10, 2010, at 11:22 AM, Tom Duke wrote:

Govinda,

OK - = your page, and the ajax page are being served as UTF-8 - but the post to = the db is incorrect.   It is encoding the pound symbol as: =

   = %27%A3

whereas = it should be

   %C2%A3

I'm no javascript expert but it = looks like you shouldn't be using 'escape()' on unicode = characters:

    http://www.dangrossman.info/2007/05/25/hand= ling-utf-8-in-javascript-php-and-non-utf8-databases/
=

the guy on the link above suggests = using 'encodeURIComponent(string)'.    Would you not = consider building your ajax stuff using the Jquery framework - that's my = plan when I get the time to sort it.

- Tom
=


=



=

= --Apple-Mail-12-902953474-- Govinda

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Works! (1997) WC2b12: Yes, Formulas.db is for real (1997) Erotic Sites (1997) Re:no [search] with NT (1997) Sorry I didn't pay attention-but ??? (1997) WebCatalog can't find database (1997) SSL problems (2002) [url] link (1998) international time (1997) Error Type 3 (1999) Re:quit command on NT (1997) Trigger Error (2001) filemaker - orderfile (1997) Navigator Parsing (1997) WebCatalog can't find database (1997) encryption madness (2004) my price won't move (1997) Sorting by date (1997) Stripping attachments in shared pop (2005) ShowIf variables (1997)