Erlang Mailing Lists

Author Message

<  Yaws mailing list  ~  Upload and Umlauts

Guest
Posted: Tue Sep 26, 2006 12:13 pm Reply with quote
Guest
Hello List,

I am fairly new to Erlang and Yaws, and by the way also new to this list,
and I have a problem that I can't seem to wrap my head around.
Unfortunately it's a lot of code and I don't know exactly where the error
happens, so I'll just try to describe it:

I am writing a complex file upload form using the recipe from Trapexit
(http://wiki.trapexit.org/index.php/How_to_setup_your_own_Web_server_with_Yaws),
and I have several other form fields of course (such as the name of the
file).

All my other code works perfectly with umlauts (German umlauts -
tobbe
Posted: Wed Sep 27, 2006 7:47 am Reply with quote
User Joined: 19 Jan 2005 Posts: 274 Location: Stockholm, Sweden
Can it be a problem with what character set are you using ?
What charset are you using and what does the browser expect ?

In your HTML 'head' part you should specify the charset used, ex:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


Cheers, Tobbe


Jan-Ole Esleben wrote:
> Hello List,
>
> I am fairly new to Erlang and Yaws, and by the way also new to this list,
> and I have a problem that I can't seem to wrap my head around.
> Unfortunately it's a lot of code and I don't know exactly where the error
> happens, so I'll just try to describe it:
>
> I am writing a complex file upload form using the recipe from Trapexit
> (http://wiki.trapexit.org/index.php/How_to_setup_your_own_Web_server_with_Yaws),
> and I have several other form fields of course (such as the name of the
> file).
>
> All my other code works perfectly with umlauts (German umlauts -
View user's profile Send private message Send e-mail Visit poster's website
Guest
Posted: Wed Sep 27, 2006 12:09 pm Reply with quote
Guest
Your reply pointed me in the right direction to solving my problem, thanks
a lot.

However, the solution is rather spooky: All my HTTP headers say the pages
are encoded as latin-1. What I needed to do to get this one particular form
working, however, was add an accept-charset attribute with a value of
_UTF-8_!

Does anybody know why this is so? Are the data encoded -- internally -- as
UTF-8 in Erlang, and only converted to latin-1 by Yaws? (That would strike
me as odd, really.)

Confused, but thanks for the pointers,
Ole


On 27.09.06, Torbjorn Tornkvist wrote:
> Can it be a problem with what character set are you using ?
> What charset are you using and what does the browser expect ?
>
> In your HTML 'head' part you should specify the charset used, ex:
>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
>
>
> Cheers, Tobbe
>
>
> Jan-Ole Esleben wrote:
> > Hello List,
> >
> > I am fairly new to Erlang and Yaws, and by the way also new to this list,
> > and I have a problem that I can't seem to wrap my head around.
> > Unfortunately it's a lot of code and I don't know exactly where the error
> > happens, so I'll just try to describe it:
> >
> > I am writing a complex file upload form using the recipe from Trapexit
> > (http://wiki.trapexit.org/index.php/How_to_setup_your_own_Web_server_with_Yaws),
> > and I have several other form fields of course (such as the name of the
> > file).
> >
> > All my other code works perfectly with umlauts (German umlauts -
tobbe
Posted: Wed Sep 27, 2006 1:37 pm Reply with quote
User Joined: 19 Jan 2005 Posts: 274 Location: Stockholm, Sweden
Jan-Ole Esleben wrote:
> Your reply pointed me in the right direction to solving my problem, thanks
> a lot.
>
> However, the solution is rather spooky: All my HTTP headers say the pages
> are encoded as latin-1. What I needed to do to get this one particular form
> working, however, was add an accept-charset attribute with a value of
> _UTF-8_!
>
> Does anybody know why this is so? Are the data encoded -- internally -- as
> UTF-8 in Erlang, and only converted to latin-1 by Yaws? (That would strike
> me as odd, really.)

No, nothing is encoded internally in any particular way.
What do you mean by saying that your pages are in latin-1 ?
What do you send as the 'charset' in your pages ?

On linux, run: iconv -l
to see names of well-known character sets.

If you specify iso-8859-1 as shown below then you should
get back iso-8859-1 characters from the browser.

However, if the browser belives the page is in UTF-8, then you will
get UTF-8 characters, and you may have to convert to iso-8859-1 if
that is the charset of the strings in your program (and vice versa).

There is a library named iconv in jungerl which can do that for you.

Cheers, Tobbe


>
> Confused, but thanks for the pointers,
> Ole
>
>
> On 27.09.06, Torbjorn Tornkvist wrote:
>> Can it be a problem with what character set are you using ?
>> What charset are you using and what does the browser expect ?
>>
>> In your HTML 'head' part you should specify the charset used, ex:
>>
>> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
>>
>>
>> Cheers, Tobbe
>>
>>
>> Jan-Ole Esleben wrote:
>>> Hello List,
>>>
>>> I am fairly new to Erlang and Yaws, and by the way also new to this list,
>>> and I have a problem that I can't seem to wrap my head around.
>>> Unfortunately it's a lot of code and I don't know exactly where the error
>>> happens, so I'll just try to describe it:
>>>
>>> I am writing a complex file upload form using the recipe from Trapexit
>>> (http://wiki.trapexit.org/index.php/How_to_setup_your_own_Web_server_with_Yaws),
>>> and I have several other form fields of course (such as the name of the
>>> file).
>>>
>>> All my other code works perfectly with umlauts (German umlauts -
View user's profile Send private message Send e-mail Visit poster's website

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum