Re: [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 = 105788
interpreted = N
texte = --Apple-Mail-4-884879878Content-Type: text/plain;charset=US-ASCII;format=flowed;delsp=yesContent-Transfer-Encoding: 7bit%27 is just the single quote before the pound symbol.. not part of the pound symbol encoding.so it means the JS is just encoding the pound symbol as it does on ISO, as:%A3Lemme look into what else you say below and then get back to you here. I assume we are not out of the woods yet.It may come down to using Jquery at some point, but for now I am wondering, how does Jquery handle the issue? Once I know that, then I can custom hack anything again from plain scratch JS. I am one of those types who likes to know what is under the hood so I have all the keys. ;-) It is slower to develop this way, but I like the power and creativity from there.Thanks!-GovindaOn 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>>------------Govindagovinda.webdnatalk@gmail.com--Apple-Mail-4-884879878Content-Type: text/html;charset=US-ASCIIContent-Transfer-Encoding: quoted-printable%27 is just the single quote =before the pound symbol.. not part of the pound symbol =encoding.
so it means the JS is just =encoding the pound symbol as it does on ISO, =as:
%A3
Lemme look into what else you =say below and then get back to you here. I assume we are not out =of the woods yet.
It may come down to using Jquery at some =point, but for now I am wondering, how does Jquery handle the issue? = Once I know that, then I can custom hack anything again from plain =scratch JS. I am one of those types who likes to know what is =under the hood so I have all the keys. ;-) It is slower to =develop this way, but I like the power and creativity from =there.
Thanks!
-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:
=
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-4-884879878--
Associated Messages, from the most recent to the oldest:Lemme look into what else you =say below and then get back to you here. I assume we are not out =of the woods yet.
It may come down to using Jquery at some =point, but for now I am wondering, how does Jquery handle the issue? = Once I know that, then I can custom hack anything again from plain =scratch JS. I am one of those types who likes to know what is =under the hood so I have all the keys. ;-) It is slower to =develop this way, but I like the power and creativity from =there.
<=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:
=
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
=
=
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...