unescape problem in Netscape 7

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • parksch2@hotmail.com

    unescape problem in Netscape 7

    Does anyone know why unescape would throw an error on certain special
    characters?

    I'm trying to unescape the string:

    Espa%F1ol

    It shou8ld display like this after it is unescaped:

    Español

    This works fine on IE but not in Netscape 7.

    Thanks in advance.

  • Martin Honnen

    #2
    Re: unescape problem in Netscape 7



    parksch2@hotmai l.com wrote:
    [color=blue]
    > Does anyone know why unescape would throw an error on certain special
    > characters?[/color]

    Which error message exactly do you get?
    [color=blue]
    > I'm trying to unescape the string:
    >
    > Espa%F1ol[/color]

    var string = 'Espa%F1ol';
    alert(unescape( string))

    works fine for me with Netscape 7.2.


    --

    Martin Honnen

    Comment

    • parksch2@hotmail.com

      #3
      Re: unescape problem in Netscape 7

      Hey Martin, that's the weird part. A bit more information I found out:
      it appears to only be breaking when the HTML is served from a dotnet
      server. Can you think of any reason why this would be happening?

      Comment

      • parksch2@hotmail.com

        #4
        Re: unescape problem in Netscape 7

        I get the following error:

        Exception... "Component returned failure code: 0x8000ffff
        (NS_ERROR_UNEXP ECTED) [nsIDOMWindowInt ernal.unescape]" nsresult:
        "0x8000ffff (NS_ERROR_UNEXP ECTED)" location: "JS frame ::
        http://url.com/file.js :: FUNCTION :: Line: 398" data: no]

        Comment

        • Martin Honnen

          #5
          Re: unescape problem in Netscape 7



          parksch2@hotmai l.com wrote:
          [color=blue]
          > it appears to only be breaking when the HTML is served from a dotnet
          > server. Can you think of any reason why this would be happening?[/color]

          Is that a static HTML document? Or HTML generated dynamically from an
          ASP.NET application? If possible post a URL where the problem occurs and
          tell us what needs to done on the page to trigger the error. I assume it
          is an encoding problem.

          Hmm, I have searched bugzilla and there have indeed been problems
          related to page encoding and the escape/unescape behaviour and the
          question whether to remain compatible to Netscape 4 or to current IE
          releases, see
          <https://bugzilla.mozill a.org/show_bug.cgi?id =212308>
          <https://bugzilla.mozill a.org/show_bug.cgi?id =44272>

          As I understand the problems have been fixed and Mozilla has been made
          IE compatible for quite some while now (after 1.4) so please try Firefox
          1.0 or Mozilla 1.7 or Netscape 7.2 whether the unescape problem you have
          is fixed there.

          I am not sure there is a workaround for those older Mozilla/Netscape
          releases.

          --

          Martin Honnen

          Comment

          • parksch2@hotmail.com

            #6
            Re: unescape problem in Netscape 7

            Thanks for the help Martin. I finally found the problem:

            On the .NET server, I had to change the encoding in the Web.config
            from:
            <globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8" />

            to:
            <globalizatio n
            requestEncoding ="iso-8859-1"responseEncod ing="iso-8859-1"/>

            and now it works....

            Not a great solution but at least a solution.

            Thanks again for all the help!

            Comment

            • VK

              #7
              Re: unescape problem in Netscape 7

              On the .NET server, I had to change the encoding in the Web.config[color=blue]
              > from:
              > <globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8" />
              > to:
              > <globalizatio n requestEncoding ="iso-8859-1"re­sponseEnco ding="iso-8859-1"/>[/color]

              Now you've got it.
              The old unescape() method works with %XX encoded *ASCII* strings. If
              you *may* use Unicode to communicate, you should use in your approach
              decodeURICompon ent() / decodeURI() methods. They support double-byte
              chars.

              Comment

              Working...