Chris,

On 3/26/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas,

Thomas Peter Berntsen wrote:
> Without the
> URIEncoding="UTF-8" parameter the Danish special characters are not
> echoed correctly, whereas _with_ the parameter everything in the
> request is echoed correctly.

Okay, good. I thought you were saying that the URIEncoding attribute
changed nothing. It sounds like it fixes most things, but not your
directory-listing thing.

Yes, it solves character issues with "normal" JSPs and forms, but not
directory listings and direct file requests.

> ...But the directory listing seems unaffected, along with the direct
> file requests which still return a 404.

Direct file requests might never be expected to work, because the
/browser/ never knows what URI encoding to use. You'll have to check
your browser's default URI encoding, and it might be different for every
browser. This is one of those places where the HTTP spec kinda falls on
its face. W3C says that UTF-8 should always be used
(http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars) but
I'm guessing that there's a lot of inertia in web servers (Tomcat uses
ISO-8859-1 for instance) and browsers (I'm guessing).

Yeah, I think you're right on that one. Perhaps a hack for Tomcat
could be conceived that, when enabled, for Tomcat's part interprets
such requests as UTF-8 always.

> I also tried to change the GET to a POST in the form, and that results
> in characters getting misrepresented, no matter if the
> URIEncoding="UTF-8" parameter is specified in the connector or not.

:(

> Absolutely, here you go:
>
> <Connector port="8080" URIEncoding="UTF-8"

Looks good to me. I think I'm out of ideas. Let's recap: how many of
these work?

1. GET form submissions
2. POST form submissions
3. Directory listings (visually, do the filenames appear correct
  in the page)
4. Links from directory listings (when you click on them, do they work)

#1 should work if you are using URIEncoding="UTF-8" (you are).

Inline special characters (SCs) display correctly, form submitted SCs
display correctly, browser detects the page encoding as being UTF-8.

#2 should always work, assuming that you have UTF-8-ized your app.

Inline SCs display correctly, form submitted SC display with errors
(displayed: æøå), browser detects UTF-8.

The JSP contains the following headers:

Placed as numero uno:
<[EMAIL PROTECTED] pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" 
%>

In the HTML <head> section:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">

#3 should always work, since the directory listing should know what
   encoding it is using, and set the content-type header correctly
   (can you verify that the directory listing page display is using
   UTF-8 by looking at the page's properties or whatever?)

Doesn't work out of the box with directory listings, even though the
browser reports that the page is encoded with UTF-8.

My custom directory listing XSL transformer, sporting an explicit
<?xml version="1.0" encoding="UTF-8"?> doesn't work either. Again the
browser acknowledges that UTF-8 is the name of the game.

#4 might not work, depending on a whole lot of things. We'll see.

Doesn't work :-)


- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGB88L9CaO5/Lv0PARAhiUAKCTlT6H0WTMK1u+Byje6HGkUhCGRwCfTpM5
hBgiBMAVm9ftKy55VHtn4Ic=
=lqEB
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to