You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Jasen Kim <ir...@gmail.com> on 2021/11/05 17:37:16 UTC

UTF-8 encoding issues in ::rivet::load_response form data

Hi guys,

I am having issues with special characters when passed through as form data.
In my input form I submit "testemailö@gmail.com"
The :rivet::load_response data returns "testemail\xc3\xb6@gmail.com"

I've tried using [encoding convertfrom utf-8 {testemail\xc3\xb6@gmail.com}]
with no success.
Any idea how I can convert the utf-8 literal back to its original character?

I've tried
set teststr "testemail\xc3\xb6@gmail.com"
puts [encoding convertfrom utf-8 $teststr]
in its own tcl script and had this working but not in the Rivet
environment.


Thanks,
Jasen

Re: UTF-8 encoding issues in ::rivet::load_response form data

Posted by Jasen Kim <ir...@gmail.com>.
Thanks Massimo. I will try this and get back to you.

On Sat, Nov 6, 2021 at 2:20 PM Massimo Manghi <ma...@gmail.com>
wrote:

> Hi Jasen
>
> what happens if you add this line at the very beginning of the script?
>
> ::rivet::headers type "text/html;charset=utf-8"
>
> Be careful to add this before any data is sent to the output channel.
>
>  -- Massimo
>
>
> On Fri, Nov 5, 2021 at 6:37 PM Jasen Kim <ir...@gmail.com> wrote:
>
>> Hi guys,
>>
>> I am having issues with special characters when passed through as form
>> data.
>> In my input form I submit "testemailö@gmail.com"
>> The :rivet::load_response data returns "testemail\xc3\xb6@gmail.com"
>>
>> I've tried using [encoding convertfrom utf-8 {testemail\xc3\xb6@gmail.com
>> }] with no success.
>> Any idea how I can convert the utf-8 literal back to its original
>> character?
>>
>> I've tried
>> set teststr "testemail\xc3\xb6@gmail.com"
>> puts [encoding convertfrom utf-8 $teststr]
>> in its own tcl script and had this working but not in the Rivet
>> environment.
>>
>>
>> Thanks,
>> Jasen
>>
>

Re: UTF-8 encoding issues in ::rivet::load_response form data

Posted by Massimo Manghi <ma...@gmail.com>.
Hi Jasen

what happens if you add this line at the very beginning of the script?

::rivet::headers type "text/html;charset=utf-8"

Be careful to add this before any data is sent to the output channel.

 -- Massimo


On Fri, Nov 5, 2021 at 6:37 PM Jasen Kim <ir...@gmail.com> wrote:

> Hi guys,
>
> I am having issues with special characters when passed through as form
> data.
> In my input form I submit "testemailö@gmail.com"
> The :rivet::load_response data returns "testemail\xc3\xb6@gmail.com"
>
> I've tried using [encoding convertfrom utf-8 {testemail\xc3\xb6@gmail.com}]
> with no success.
> Any idea how I can convert the utf-8 literal back to its original
> character?
>
> I've tried
> set teststr "testemail\xc3\xb6@gmail.com"
> puts [encoding convertfrom utf-8 $teststr]
> in its own tcl script and had this working but not in the Rivet
> environment.
>
>
> Thanks,
> Jasen
>