tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: mod_jk codepage in header values
Date Sat, 30 Jan 2010 12:56:10 GMT
On 29.01.2010 22:20, Christopher Schultz wrote:
> Hash: SHA1
> Mirko,
> On 1/29/2010 4:02 AM, Mirko Solic wrote:
>> Secondly i try to define JkEnvVar directive for non existent environment
>> variable and i added also default value with some no ISO-8859-1
>> characters. My conf file is in utf8 encoding so default value should
>> also be in utf8 encoding.
> I'd be interested in how Apache httpd reads the httpd.conf file. If it
> reads the file in utf-8 encoding, then this could be a problem with
> mod_jk. If it reads it using ISO-8859-1 or US-ASCII or something like
> that, then the data is already broken before mod_jk gets ahold of it.
> You might want to re-post your question by saying that UTF-8 data is
> incorrectly transmitted to request /attributes/ and see if any of the
> mod_jk devs can take a look at that.

Apache env vars are simple C strings, i.e. sequences of single byte 
chars. They are copied and forwarded as such by mod_jk when configured 
using JkEnvVar as request attributes. I also expect any strings in the 
Apache config are read as such strings (at least on all platforms not 
having an exotic native charset like EBCDIC). The values should not get 
decoded or encoded in any way as long as they are only Apache 
environment variables.

So I expect you can forward any binary garbage you like, as long as you 
make sure the code putting it into the environment variables doesn't 
already do any encoding or decoding.

Now: it seems that Tomcat is by default assuming it needs to transform 
the binary AJP data stream for request attributes into ISO-8859-1 
decoded Java strings. I'm not 100% sure here, but this is the likely the 
most important part of the game.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message