[HTML_AJAX-devel] [Fwd: HTML_AJAX.formSubmit encoding/charset]
Otto Berger
bruno at hilight.de
Tue Jul 18 11:28:24 PDT 2006
hi Josh,
hi Laurent,
many thanks!
Otto
Joshua Eichorn schrieb:
> This change has been made in svn and will be available in 0.5.0 whenever
> i get it released.
> -josh
> Otto Berger wrote:
>> Hi,
>>
>> is it possible to change the formEncode function regarding my character
>> encoding problem? Or did i miss some other side effects?
>>
>> Otto
>>
>>
>> related post:
>> --------------
>>
>> Hi Laurent,
>>
>> sorry for my late answer, but i recognized the following: If i replace
>> the encode function with encodeURIComponent it works perfectly for me:
>>
>> Line 324 of HTML_AJAX.js:
>>
>> escName = escape(name);
>> if (array_format) {
>> value = el.value;
>> } else {
>> value = encodeURIComponent(el.value);
>> // value = escape(el.value);
>> }
>>
>>
>>
>> I used "encodeURIComponent" instead of "encodeURI" because of the
>> encoding of "&" chars etc. This change works for me in all cases - but
>> maybe there are some other side-effects?
>>
>> cheers,
>> Otto
>>
>> Laurent Yaish schrieb:
>>
>>> Hi Otto,
>>>
>>> seems like we should be using encodeURI instead of escape.
>>> The reason why the values were being escaped is because formEncode
>>> builds a url with all the GET vars, and therefore we must deal with
>>> special characters (i.e. spaces and such)
>>>
>>> try replacing escape by encodeURI, I'll run some tests on HTML_AJAX
>>> also.
>>>
>>> Thanks,
>>>
>>> Laurent
>>>
>>> On 6/1/06, Otto Berger <bruno at hilight.de> wrote:
>>>
>>>> Hi,
>>>>
>>>> i found out that this is issued by the escape function in the
>>>> formEncode
>>>> function:
>>>>
>>>> value = escape(el.value);
>>>>
>>>> if i disable the escaping of the form values, special chars are
>>>> transmitted correctly...
>>>>
>>>> Must i expect any other effects on this change?
>>>>
>>>> Otto
>>>>
>>>>
>>>> Otto Berger schrieb:
>>>>
>>>>> Hi all,
>>>>>
>>>>> i know about the encoding options on the server and client side -
>>>>> but i
>>>>> got a problem while sending a html-form:
>>>>>
>>>>> - form-input-fields are filled using mysql (utf-8) and HTML_AJAX
>>>>>
>>>> with no
>>>>
>>>>> encoding problems (german special chars like öäü are displayed
>>>>>
>>>> correctly)
>>>>
>>>>> - http- and html-header informations are (in my oppinion ;-)) correct
>>>>>
>>>>> But submitting the form using HTML_AJAX.formSubmit results in encoding
>>>>> chaos (special chars are displayed as '?' (Questionmarks)
>>>>>
>>>>> i've tested with firefox and IE6.
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Otto
>>>>>
>>>>>
>>
>> _______________________________________________
>> Html_ajax-devel mailing list
>> Html_ajax-devel at lists.bluga.net
>> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>>
>
More information about the Html_ajax-devel
mailing list