2 Replies Latest reply on May 16, 2011 10:36 AM by orafad

    Another character set problem

    Igor Kortchnoï
      Apex 3.2.1 through Apex Listener 1.1.1 on Glassfish 3.1

      At client's site, there is a link, passing some accentuated characters to the called page,
      a href="f?p=25102:2:8725117467258765::NO::P2_001:modif.%20Activit%C3%A9" X /a

      and a button
      a href="javascript:redirect('f?p=25102:2:8725117467258765::NO::P2_001:New%20Activit%C3%A9')" class="t20Button" Créer/a

      On my workstation, everything works OK.
      On client's site, when trying to click on the button, we get the following exception in glassfish log :

      Illegal character in query at index ...: f?p=25102:2:829283595178127::NO::P2_001:New%20Activité

      Client's DB NLS settings are similar to ours, except NLS_CHARACTERSET (Us: WE8MSWIN1252, client: WE8ISO8859P1). Client has 11R2 and we have 11R1 (.

      What should be done at glassfish (or DB) level to fix this problem?

      Thank you.
        • 1. Re: Another character set problem
          Hi Igor,

          seems the GlassFish doesn't get the URL-encoded version of the character. The character is available in all affected charsets, so I wouldn't expect any trouble there. You could check if the GlassFish actually uses UTF-8, which would be the default, or if it is configured to use some incompatible charset.
          If you imported any data or the application with improper character set settings in APEX, you may have some "garbage" in your application. In that case, reimporting the application with the characterset you have in your exporting database might help.
          Anyway, I'd expect to see this garbage URL-encoded.
          Does your client use the same browser or could it be the browser doesn't handle the request correctly?

          • 2. Re: Another character set problem
            Continuing on what Udo wrote:
            Anyway, I'd expect to see this garbage URL-encoded.
            Does your client use the same browser or could it be the browser doesn't handle the request correctly?

            What you are seeing/describing could be related to incorrect assumptions between client/browser and app server (about e.g. encoding) or possibly incorrect explicit settings or platform differences.

            I think the problem is two-fold; link value gets re-encoded and also not "url encoded". The latter is likely why the "Illegal character" error.

            The button link:
            a href="javascript:redirect('f?p=25102:2:8725117467258765::NO::P2_001:New%20Activit%C3%A9')"
            I take it that the last character is supposed to be U+00E9 "LATIN SMALL LETTER E WITH ACUTE" - as in New Activité.

            The character's code representation in hex bytes 0xc3 0xa9 is url encoded as %C3%A9, in the button link.

            If browser sees this link as encoded in single-byte (e.g. win1252) character set - "Activité" - and then applies utf-8 encoding:
            => C3 83 C2 A9 (for the last two "characters" U+00C3 = Ã, U+00A9 = ©)

            Each code unit should then have been url-encoded, but that did not happen.

            ...: f?p=25102:2:829283595178127::NO::P2_001:New%20Activité
            This is probably from log file opened with assumption of win-1252 (i.e. probably just double-clicking the log file)

            é representing:

            C3 = Ã (captial a with tilde)
            83 = ƒ (small letter f with hook)
            C2 = Â (capital a with circumflex)
            A9 = © (copyright sign)

            Instead of displaying the unicode characters é.

            Edited by: orafad on May 16, 2011 12:36 PM