Character encoding

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter

    Character encoding

    Hi everybody

    I have a webpage with two forms on it. The reciever of the data from
    Form1 wants the encoding to be UTF-8 while the receiver of Form2 wants
    it in iso-8859-1. Is there a way to tell the browser to send forms in
    a different encoding than the encoding of the html document?

    / Peter
  • Kris

    #2
    Re: Character encoding

    In article <fbd48700.03092 70139.77356fbc@ posting.google. com>,
    paagaard@hotmai l.com (Peter) wrote:
    [color=blue]
    > I have a webpage with two forms on it. The reciever of the data from
    > Form1 wants the encoding to be UTF-8 while the receiver of Form2 wants
    > it in iso-8859-1. Is there a way to tell the browser to send forms in
    > a different encoding than the encoding of the html document?[/color]

    I am not absolutely sure, but that sounds like a job for the
    accept-charset attribute (on FORM).

    <http://www.w3.org/TR/html4/interact/forms.html#adef-accept-charset>

    --
    Kris
    kristiaan@xs4al l.netherlands (nl)
    "We called him Tortoise because he taught us" said the Mock Turtle.

    Comment

    • Peter

      #3
      Re: Character encoding

      > I am not absolutely sure, but that sounds like a job for the[color=blue]
      > accept-charset attribute (on FORM).[/color]
      Thanks for the suggestion but unfortunately it didnt work :-(
      I might add that I am using the GET method to send the data and the
      webpage is in UTF-8 encoding. When I try to use a special character
      from the iso-8859-1 charset it gets url encoded to its UTF-8
      representations (two characters) instead of iso-8859-1s (only one
      character).

      /Peter

      Comment

      • Alan J. Flavell

        #4
        Re: Character encoding

        On Sat, 27 Sep 2003, Peter wrote:
        [color=blue]
        > I have a webpage with two forms on it. The reciever of the data from
        > Form1 wants the encoding to be UTF-8 while the receiver of Form2 wants
        > it in iso-8859-1.[/color]

        I'm afraid that you'll first need to read my notes at

        [color=blue]
        > Is there a way to tell the browser to send forms in
        > a different encoding than the encoding of the html document?[/color]

        In theory, yes. In practice, not really. It's hard enough to cope
        with what browsers do anyway, without putting extra constraints on
        them in the way that you're suggesting.

        I'd have to recommend writing some kind of wrapper script to
        homogenize the input to whatever their misguided scripts are hoping to
        get. Perl has some pretty powerful magic for doing that kind of
        thing: however, I haven't myself tried doing what you would need for
        this in detail, so I'm afraid the advice from me is rather general.
        Certainly the answer is going to be far removed from simply "authoring
        HTML"; depending on which aspects you'd encounter problems with, I'd
        refer you to comp.infosystem s.www.authoring.cgi (automoderated, check
        its posting guidelines) or to whichever ofcomp.lang.per l.(misc|modules )
        seems more relevant to the specific problem.

        Comment

        Working...