Loading ...
Sorry, an error occurred while loading the content.

Re: Connection Manager and UTF-8 (problem only with IE)

Expand Messages
  • Lucas Smith
    ... code. ... [snip] Ok, I m able to reproduce your ???? case. Unfortunately, I m not sure what could be the cause of it, but I m asking around. Luke
    Message 1 of 7 , Oct 1, 2008
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "Tom" <tomnyc2004@...> wrote:
      >
      > You are right. I guess the two "divs" got lost when I simplified my
      code.
      > I am actually not sure if the way I am dividing the yui dialog example
      > into two functions is correct: what I am doing is having one
      > init-function and then extracting the form validate function and the
      > dialog.show() into another function since later on I want to call this
      > second function (ShowDialog) and provide it with an id that has an
      > impact on the form validate function.
      >
      > If I understand your question "What values are you passing to the
      > form?" right ... all i do is switching the windows default input
      > language to chinese and type chinese characters (whatever they mean)
      > into the form and click submit.
      >
      >
      [snip]

      Ok, I'm able to reproduce your ???? case. Unfortunately, I'm not sure
      what could be the cause of it, but I'm asking around.

      Luke
    • tssha
      ... Add the following code before the asyncRequest() call: YAHOO.util.Connect._default_post_header = application/x-www-form-urlencoded; charset=UTF-8
      Message 2 of 7 , Oct 1, 2008
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "Tom" <tomnyc2004@...> wrote:
        >
        > hi all,
        >
        > I feel a little bit stupid because I just cannot figure out what causes
        > my problem. so I hope you can help me:
        >
        > my whole website is utf-8 (php-header, meta-tag, files saved as utf-8,
        > mysql utf-8).
        > I never had a problem with that.
        > Now I am using the dialog with two simple fields and want the user
        > inputs to be saved in MySQL with the connection manager.
        >
        > For now and for debug purposes the php file that is executed via the
        > connection manager does only write to a text file (which is also utf-8).
        > This works perfect in Firefox.
        > In IE (7) I only get ????? (question marks).
        >
        > I really hope you can help me here.

        <snip>

        Add the following code before the asyncRequest() call:

        YAHOO.util.Connect._default_post_header =
        "application/x-www-form-urlencoded; charset=UTF-8"
        // All subsequent asyncRequest() calls to follow.

        What do you see in your file, now, when using IE? The expected
        characters or rubbish, still?

        Regards,
        Thomas
      • tssha
        ... causes ... utf-8). ... Actually, strike the previous suggestion. I wrongly assumed you were using the Dialog s form submission routine. In looking at the
        Message 3 of 7 , Oct 1, 2008
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, "tssha" <tsha@...> wrote:
          >
          > --- In ydn-javascript@yahoogroups.com, "Tom" <tomnyc2004@> wrote:
          > >
          > > hi all,
          > >
          > > I feel a little bit stupid because I just cannot figure out what
          causes
          > > my problem. so I hope you can help me:
          > >
          > > my whole website is utf-8 (php-header, meta-tag, files saved as utf-8,
          > > mysql utf-8).
          > > I never had a problem with that.
          > > Now I am using the dialog with two simple fields and want the user
          > > inputs to be saved in MySQL with the connection manager.
          > >
          > > For now and for debug purposes the php file that is executed via the
          > > connection manager does only write to a text file (which is also
          utf-8).
          > > This works perfect in Firefox.
          > > In IE (7) I only get ????? (question marks).
          > >
          > > I really hope you can help me here.
          >
          > <snip>
          >
          > Add the following code before the asyncRequest() call:
          >
          > YAHOO.util.Connect._default_post_header =
          > "application/x-www-form-urlencoded; charset=UTF-8"
          > // All subsequent asyncRequest() calls to follow.
          >
          > What do you see in your file, now, when using IE? The expected
          > characters or rubbish, still?

          Actually, strike the previous suggestion. I wrongly assumed you were
          using the Dialog's form submission routine.

          In looking at the URI, you are retrieving the values from Dialog's
          getData. However, I do not see any encoding operation performed on
          the data before it is sent. Try performing encodeURIComponent() on
          data.name and data.descr in the querystring. Any special characters
          in these fields will be safely expressed as %## before being sent to PHP.

          Regards,
          Thomas
        • Tom
          I am sorry. I was away for some days. I think the encodeURIComponent did it though I was sure that I tried that before. But great, thanks a lot!!!! ...
          Message 4 of 7 , Oct 6, 2008
          • 0 Attachment
            I am sorry.
            I was away for some days.

            I think the "encodeURIComponent" did it though I was sure that I tried
            that before.

            But great, thanks a lot!!!!


            --- In ydn-javascript@yahoogroups.com, "tssha" <tsha@...> wrote:
            >
            > --- In ydn-javascript@yahoogroups.com, "tssha" <tsha@> wrote:
            > >
            > > --- In ydn-javascript@yahoogroups.com, "Tom" <tomnyc2004@> wrote:
            > > >
            > > > hi all,
            > > >
            > > > I feel a little bit stupid because I just cannot figure out what
            > causes
            > > > my problem. so I hope you can help me:
            > > >
            > > > my whole website is utf-8 (php-header, meta-tag, files saved as
            utf-8,
            > > > mysql utf-8).
            > > > I never had a problem with that.
            > > > Now I am using the dialog with two simple fields and want the user
            > > > inputs to be saved in MySQL with the connection manager.
            > > >
            > > > For now and for debug purposes the php file that is executed via the
            > > > connection manager does only write to a text file (which is also
            > utf-8).
            > > > This works perfect in Firefox.
            > > > In IE (7) I only get ????? (question marks).
            > > >
            > > > I really hope you can help me here.
            > >
            > > <snip>
            > >
            > > Add the following code before the asyncRequest() call:
            > >
            > > YAHOO.util.Connect._default_post_header =
            > > "application/x-www-form-urlencoded; charset=UTF-8"
            > > // All subsequent asyncRequest() calls to follow.
            > >
            > > What do you see in your file, now, when using IE? The expected
            > > characters or rubbish, still?
            >
            > Actually, strike the previous suggestion. I wrongly assumed you were
            > using the Dialog's form submission routine.
            >
            > In looking at the URI, you are retrieving the values from Dialog's
            > getData. However, I do not see any encoding operation performed on
            > the data before it is sent. Try performing encodeURIComponent() on
            > data.name and data.descr in the querystring. Any special characters
            > in these fields will be safely expressed as %## before being sent to
            PHP.
            >
            > Regards,
            > Thomas
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.