You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Prabhu Mannu <pr...@fernridge.com> on 2015/01/23 08:21:15 UTC

Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Hi all,

Firs off Sorry if this question appears too noob.

Currently in my application I get this warning.
HTML1114: Codepage iso-8859-1 from (HTTP header) overrides conflicting
codepage utf-8 from (META tag)
File: index.action

Application uses struts 2, spring, hibernate, jpa + tiles 3 framework.

The application does have this meta tag in all the jsp files
<meta charset="utf-8">

Tomcat version 8 is used
Server version:        Apache Tomcat/8.0.15
JVM Version:           1.7.0_51-b13
JVM Vendor:            Oracle Corporation

Also have as java parameters
-Dfile.encoding=UTF-8 and
-Djavax.servlet.request.encoding=UTF-8


In server.xml
<Connector connectionTimeout="20000" port="8089" protocol="HTTP/1.1"
redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true" />

In web.xml in conf folder
    <filter>
        <filter-name>setCharacterEncodingFilter</filter-name>
 
<filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter
-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <async-supported>true</async-supported>
    </filter>
<filter-mapping>
        <filter-name>setCharacterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

In web.xml of the application 
<jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <page-encoding>UTF-8</page-encoding>
            <trim-directive-whitespaces>true</trim-directive-whitespaces>
        </jsp-property-group>
    </jsp-config>

<filter>
  <filter-name>setCharacterEncodingFilter</filter-name>
 
<filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter
-class>
  <init-param>
   <param-name>encoding</param-name>
   <param-value>UTF-8</param-value>
  </init-param>
 </filter>
<filter-mapping>
  <filter-name>setCharacterEncodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

But I still get this warning
Codepage iso-8859-1 from (HTTP header) overrides conflicting codepage utf-8
from (META tag)


I tried to move/change the order of the filters for setting encoding but
doesn't seem to make any difference.

I cannot figure out what is wrong and why the http header is saying
iso-8859-1 encoding instead of utf-8. I need utf-8 cause this application
need to support Japanese language.

I welcome anyone to give me any suggestion/comments/or pointers on what I am
doing wrong.

With regards
Prabhu 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by André Warnier <aw...@ice-sa.com>.
Caldarale, Charles R wrote:
>> From: André Warnier [mailto:aw@ice-sa.com] 
>> Subject: Re: [OT] Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header
> 
>> German has its own confusing quirks.
> 
> I always liked Schmetterling; the sound is so counter-indicative of the actual entity.
>

There is a delicious "spanglish" beginning of a poem that features one of those.  It 
starts with "One morning, una mariposa was flying in the garden..".

>> And let's not even talk about the tongue-twisting and Scrabble-cheating 
>> Bezirksschorsteinfegermeister who visits me every year.
> 
> Or is that Bezirksschornsteinfegermeister?  Gonna need a bigger Scrabble board...
> 

Correct, I missed an "n".  That was one of my first experiences in Germany. He rang the 
bell, handed me his business card, and before I had finished reading it (see above), he 
was already walking past me and down into the cellar, to check the heating system.

Ok, I guess it's enough now with flouting Tomcat's international and intercultural appeal.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: [OT] Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: André Warnier [mailto:aw@ice-sa.com] 
> Subject: Re: [OT] Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

> German has its own confusing quirks.

I always liked Schmetterling; the sound is so counter-indicative of the actual entity.

> And let's not even talk about the tongue-twisting and Scrabble-cheating 
> Bezirksschorsteinfegermeister who visits me every year.

Or is that Bezirksschornsteinfegermeister?  Gonna need a bigger Scrabble board...

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by André Warnier <aw...@ice-sa.com>.
Martin Knoblauch wrote:
> On Sat, Jan 24, 2015 at 1:52 PM, André Warnier <aw...@ice-sa.com> wrote:
> 
>> Christopher Schultz wrote:
>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA256
>>>
>>> André,
>>>
>>>  ...
>>
>>>  Morality : in web applications, always specify the content-type
>>>> (and character set, if applicable) of what you are returning.
>>>>
>>> To André: the word you are looking for is "Moral", not "Morality". A
>>> "moral" is the essential message of a story, while "morality" is being
>>> able to tell the difference between right and wrong. ;)
>>>
>>>
>> Thanks for the vocabulary note.  I my defense, I would say that this
>> family of English terms is a bit confusing, for a native French-speaker.
>>
>> The English terms "moral*" are originally undoubtedly imported from the
>> French language (William the Conqueror was after all a Frenchman).  But
>> they kind of messed it up during the import procdure, since in French :
>>
>> "moral" can be a noun or an adjective.  As a noun ("le moral"), it means
>> what in English is "the morale" (like "..of the troops"). As a masculine
>> adjective, it means "that which is moral/ethical". And that adjective also
>> has a corresponding feminine form "morale".
>> So you would say :
>> - ce conte (masculine) est très moral (this tale is very moral/ethical)
>> but
>> - cette fable (feminine) est très morale (this fable is very moral/ethical)
>>
>> On the other hand, "la morale" (feminine noun) is what in English would be
>> translated as "the morality" (or "the ethics").
>> And to top it all, the English "the moral of this story" would be best
>> translated in French as "la moralité de cette histoire".
>> A bit confusing, he ?
>>
>> There are many such things between different - but related - languages,
>> some of them often leading to amusing situations.  For example, the word in
>> spanish for "suffering from a cold" is "constipado", which is very close to
>> the french word for being incapable to go to the toilet ("constipé"). And
>> the English adjective "embarassed" (also imported from the French
>> "embarassé(e)", and with the same meaning), is very close to the Spanish
>> "embarassada", which means "pregnant".
>>
>> This all just in case someone was wondering about my interest in character
>> set issues on the WWW..
>>
>>
> Ant then there are the people who think German is a difficult language ...
> :-)
> 

It is. German has its own confusing quirks.
It is for example the only language that I know, in which "die Hose" (the trousers) and 
"die Sonne" (the Sun) are feminine, while "der Rock" (the dress) and "der Mond" (the Moon) 
are masculine. I mean, who else than a German would look at the Sun, and think "she" ? 
(And it long predates Mrs Merkel).
And German also has its own complement of words imported from French, but with a different 
meaning, e.g. : "Kommode", which in Germany is just a coat-hanger on the wall, but in the 
original French is a massive piece of furniture which would never fit where a German 
Kommode does.  Or the (delicious) French word "praline", which in German has become 
"Praliné" (with Capital, like almost everyThing in German), while the original French 
"praliné" is just a chocolate-based filling. And let's not even talk about the 
tongue-twisting and Scrabble-cheating Bezirksschorsteinfegermeister who visits me every year.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by Martin Knoblauch <kn...@gmail.com>.
On Sat, Jan 24, 2015 at 1:52 PM, André Warnier <aw...@ice-sa.com> wrote:

> Christopher Schultz wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> André,
>>
>>  ...
>
>
>>  Morality : in web applications, always specify the content-type
>>> (and character set, if applicable) of what you are returning.
>>>
>>
>> To André: the word you are looking for is "Moral", not "Morality". A
>> "moral" is the essential message of a story, while "morality" is being
>> able to tell the difference between right and wrong. ;)
>>
>>
> Thanks for the vocabulary note.  I my defense, I would say that this
> family of English terms is a bit confusing, for a native French-speaker.
>
> The English terms "moral*" are originally undoubtedly imported from the
> French language (William the Conqueror was after all a Frenchman).  But
> they kind of messed it up during the import procdure, since in French :
>
> "moral" can be a noun or an adjective.  As a noun ("le moral"), it means
> what in English is "the morale" (like "..of the troops"). As a masculine
> adjective, it means "that which is moral/ethical". And that adjective also
> has a corresponding feminine form "morale".
> So you would say :
> - ce conte (masculine) est très moral (this tale is very moral/ethical)
> but
> - cette fable (feminine) est très morale (this fable is very moral/ethical)
>
> On the other hand, "la morale" (feminine noun) is what in English would be
> translated as "the morality" (or "the ethics").
> And to top it all, the English "the moral of this story" would be best
> translated in French as "la moralité de cette histoire".
> A bit confusing, he ?
>
> There are many such things between different - but related - languages,
> some of them often leading to amusing situations.  For example, the word in
> spanish for "suffering from a cold" is "constipado", which is very close to
> the french word for being incapable to go to the toilet ("constipé"). And
> the English adjective "embarassed" (also imported from the French
> "embarassé(e)", and with the same meaning), is very close to the Spanish
> "embarassada", which means "pregnant".
>
> This all just in case someone was wondering about my interest in character
> set issues on the WWW..
>
>
Ant then there are the people who think German is a difficult language ...
:-)

Cheers
Martin

Re: [OT] Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
On 1/25/2015 4:29 PM, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> André,
>
> On 1/24/15 7:52 AM, André Warnier wrote:
>> Christopher Schultz wrote:
>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>>>
>>> André,
>>>
>> ...
>>
>>>> Morality : in web applications, always specify the
>>>> content-type (and character set, if applicable) of what you are
>>>> returning.
>>> To André: the word you are looking for is "Moral", not
>>> "Morality". A "moral" is the essential message of a story, while
>>> "morality" is being able to tell the difference between right and
>>> wrong. ;)
>>>
>> Thanks for the vocabulary note.  I my defense, I would say that
>> this family of English terms is a bit confusing, for a native
>> French-speaker.
> Oh, English is a cluster-@#$*&)% because the sentence structure is
> insane and the vocabulary has been robbed from every other language in
> history. I don't envy anyone trying to learn English.. it must seem to
> chaotic compared to German or Latin-based languages (both of which I
> have studied, and they have a certain beautiful order to them ... most
> of the time).
>
> You usually have impeccable English (better than most Americans, at
> least), which is why I went ahead and gave you the short lesson.
>
>> There are many such things between different - but related -
>> languages, some of them often leading to amusing situations.  For
>> example, the word in spanish for "suffering from a cold" is
>> "constipado", which is very close to the french word for being
>> incapable to go to the toilet ("constipé").
> Hah. I would have assumed both of those words were the latter
> (gastrointestinal distress).
>
>> And the English adjective "embarassed" (also imported from the
>> French "embarassé(e)", and with the same meaning), is very close to
>> the Spanish "embarassada", which means "pregnant".
>>
>> This all just in case someone was wondering about my interest in
>> character set issues on the WWW..
> Just don't be embarrassed. Of pregnant. Or whatever. :)
>
> - -chris


embarazada

-Terence Bandoian


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

André,

On 1/24/15 7:52 AM, André Warnier wrote:
> Christopher Schultz wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> 
>> André,
>> 
> ...
> 
>> 
>>> Morality : in web applications, always specify the
>>> content-type (and character set, if applicable) of what you are
>>> returning.
>> 
>> To André: the word you are looking for is "Moral", not
>> "Morality". A "moral" is the essential message of a story, while
>> "morality" is being able to tell the difference between right and
>> wrong. ;)
>> 
> 
> Thanks for the vocabulary note.  I my defense, I would say that
> this family of English terms is a bit confusing, for a native
> French-speaker.

Oh, English is a cluster-@#$*&)% because the sentence structure is
insane and the vocabulary has been robbed from every other language in
history. I don't envy anyone trying to learn English.. it must seem to
chaotic compared to German or Latin-based languages (both of which I
have studied, and they have a certain beautiful order to them ... most
of the time).

You usually have impeccable English (better than most Americans, at
least), which is why I went ahead and gave you the short lesson.

> There are many such things between different - but related -
> languages, some of them often leading to amusing situations.  For
> example, the word in spanish for "suffering from a cold" is
> "constipado", which is very close to the french word for being
> incapable to go to the toilet ("constipé").

Hah. I would have assumed both of those words were the latter
(gastrointestinal distress).

> And the English adjective "embarassed" (also imported from the
> French "embarassé(e)", and with the same meaning), is very close to
> the Spanish "embarassada", which means "pregnant".
> 
> This all just in case someone was wondering about my interest in 
> character set issues on the WWW..

Just don't be embarrassed. Of pregnant. Or whatever. :)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUxW5BAAoJEBzwKT+lPKRYQroP/AsixSYWCRXHQV/LcesD/gT2
N4fRHr16+vDnFW2w+kXPz9PWg/9sa8BN4k6McZ+Ts2yV7BBps0SPFqtSiKPxCsby
JW1j5HH2lPAq38DdUS50OtwXWkd04qs3lZVJ2bLG9kt8MVgxJP4avgXtuQvu9Cd8
7EeNrfJ5LHkljZfpO7ctTG/Qgu+4AnTJDHDMbI6fQqR+t0860wqAJ/1fanVbe5/+
b8FyyV6NvMki2Rhgblx8NVeCTQqHdbjlDcf1279yYwTafJGVHof68DFkWC5D9PUD
6BkfPDPm1lmVHTkp794d+wQPUuNqUT1+S0se6WcVNgGebbgGI0lfX8LhviBRejKY
CIdTu/Oc28pTjDWfbXJvQfpP3ZWuuiHb0vwcKAxQPj49cxPs4O6LTUB5gj+9mcT9
VuFMJHpSDr8MXgE11WeEbkPlt+Q32xV4BXTSu291U9/GBIpf9PFBtwCI8PqewT34
vpFvLyUIfu8zT2sXeMAF5GpTW6cEiMMthTKi1T2RpEI9tz1+ANXFW1RferqfMFKE
gOdL5yKFa8f2DO7ODCO0RH2t7kpNfJJSe9EDCTyf1CDo/ZkGbExdBoEnwB6kK3vP
B756P9gsS/DMFILWV9rfchGChLzANb5TRSquDHmQAgnLEKaqiVwWganZhrqknJd+
q4nls6bq4FD6qiKq2zHZ
=Ac3v
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by André Warnier <aw...@ice-sa.com>.
Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> André,
> 
...

> 
>> Morality : in web applications, always specify the content-type
>> (and character set, if applicable) of what you are returning.
> 
> To André: the word you are looking for is "Moral", not "Morality". A
> "moral" is the essential message of a story, while "morality" is being
> able to tell the difference between right and wrong. ;)
> 

Thanks for the vocabulary note.  I my defense, I would say that this family of English 
terms is a bit confusing, for a native French-speaker.

The English terms "moral*" are originally undoubtedly imported from the French language 
(William the Conqueror was after all a Frenchman).  But they kind of messed it up during 
the import procdure, since in French :

"moral" can be a noun or an adjective.  As a noun ("le moral"), it means what in English 
is "the morale" (like "..of the troops"). As a masculine adjective, it means "that which 
is moral/ethical". And that adjective also has a corresponding feminine form "morale".
So you would say :
- ce conte (masculine) est très moral (this tale is very moral/ethical)
but
- cette fable (feminine) est très morale (this fable is very moral/ethical)

On the other hand, "la morale" (feminine noun) is what in English would be translated as 
"the morality" (or "the ethics").
And to top it all, the English "the moral of this story" would be best translated in 
French as "la moralité de cette histoire".
A bit confusing, he ?

There are many such things between different - but related - languages, some of them often 
leading to amusing situations.  For example, the word in spanish for "suffering from a 
cold" is "constipado", which is very close to the french word for being incapable to go to 
the toilet ("constipé"). And the English adjective "embarassed" (also imported from the 
French "embarassé(e)", and with the same meaning), is very close to the Spanish 
"embarassada", which means "pregnant".

This all just in case someone was wondering about my interest in character set issues on 
the WWW..



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

André,

On 1/23/15 5:04 AM, André Warnier wrote:
> It was actually a good question, and a good explanation of your
> problem. Bonus points for that. That you found the solution
> yourself afterward, and communicated this to the list, are two
> additional bonus points.

+1

> A part of what I wanted to say in my original answer, is that just
> by taking the time to actually think about the problem you are
> having, and writing down a clear explanation for someone else, you
> often find the solution yourself.

Agreed. I find that once I explain a problem I'm having to my wife
(who is not in any way trained in software development, etc.), I've
determined the solution to the problem by the time I get to the end of
the explanation without her having to say anything. That's best for
both of us because usually she would just shrug and say "good luck
with that".

> Morality : in web applications, always specify the content-type
> (and character set, if applicable) of what you are returning.

To André: the word you are looking for is "Moral", not "Morality". A
"moral" is the essential message of a story, while "morality" is being
able to tell the difference between right and wrong. ;)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUwrmlAAoJEBzwKT+lPKRYmKEQAJXzI40qx51bMzws5PDWZAeZ
Ljrosn1VBfllmW+VhzpJ5YiQclOovg3IHa8+Rlw9JQmh9q0kCrB49LdKI8qTfLCH
O8ygnUSt025uO+WgVwNcAAvRo2aAdN+YNdhbk+RVbi19Y7cLjQYe7UeLcPnINUcl
JXPjp05vReuTr8O8/l4Gstw73LVK0aePdOBiUWFkBFMEmtRJYu1I/zCmaZ1ZYcvZ
I5+toFzZc6/hID/uyZHwBvaN98mwCMyxWtJb0Gj7uGj1OWaKvVOrAAClJ+BE/n4C
4gIEdkBHz94z60H50+OP7IFLCikvMEJOBQ+veIdYNDybJXRS1v77w/T441GqqcuU
ljrJKDnVlAbqzpYa18nSIvdTbewcIzyFdhQ6Dh00YE6HKcm26GTWXQZ8ZSaYBTJ1
/0tnUMnJq8WysnnJ2mvqbKz4vIT2VjuTRwl4nwdM0aeVoWWQhqKWwfA6+ieSflKM
mxMql/wQmqdPNP/B0Dv254tM8taL+bHHZWsRLKk9BAHwiVY2ZL4wCwOXwLZOadrH
+szyiTaubJFhqdvqHbqGNhK84ESZ7Zw1bsEFe1SIeaUM5a/O1Td2poWlodBJGibX
dCBUt22dPlgCcbYB2o14uuXgWVdd/nL61XIzRKVRT2rfbkeKki4ySjy7R4Z/UsD/
IKsiXHwBCSqlcKEyRowy
=grFu
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


[OT] Re: Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by Mark Thomas <ma...@apache.org>.
On 23/01/2015 21:16, Christopher Schultz wrote:
> David,
> 
> On 1/23/15 8:26 AM, David kerber wrote:
>> On 1/23/2015 5:04 AM, André Warnier wrote:
>>> A part of what I wanted to say in my original answer, is that
>>> just by taking the time to actually think about the problem you
>>> are having, and writing down a clear explanation for someone
>>> else, you often find the solution yourself.
> 
>> Add in the exercise of boiling the code or page down to minimum 
>> necessary to exhibit the problem, and I have found my own fixes
>> while preparing to post a question, too many times to count.
> 
> I have easily written 50 messages to this list that have never been
> sent, because simply by compiling my steps and research into a proper
> question, I find that I missed something fairly obvious.
> 
> It's how I keep my stellar reputation on this list.
> 
> (The dev list is another story: I think both Mark and Konstantin have
> commit alerts with my name attached so they can go look at all the
> stupid things I did and then make me fix them all. :)

And there was me thinking it was Remy and Konstantin keeping an eye on
me :). You only have to look at the archives to find the long list of
silly mistakes I have made over the years.

Being serious for a minute, I do think that the Tomcat dev community is
a great place to get more involved in open source. If anyone on the
users list wants to get more involved in bug fixing, improving
documentation, implementing new features etc. then do hop over to the
dev list. There is plenty to do and we are always on the look out for
more volunteers. What ever it is you want to get involved in, let us
know on the dev list and we can point you in the right direction.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

David,

On 1/23/15 8:26 AM, David kerber wrote:
> On 1/23/2015 5:04 AM, André Warnier wrote:
>> A part of what I wanted to say in my original answer, is that
>> just by taking the time to actually think about the problem you
>> are having, and writing down a clear explanation for someone
>> else, you often find the solution yourself.
> 
> Add in the exercise of boiling the code or page down to minimum 
> necessary to exhibit the problem, and I have found my own fixes
> while preparing to post a question, too many times to count.

I have easily written 50 messages to this list that have never been
sent, because simply by compiling my steps and research into a proper
question, I find that I missed something fairly obvious.

It's how I keep my stellar reputation on this list.

(The dev list is another story: I think both Mark and Konstantin have
commit alerts with my name attached so they can go look at all the
stupid things I did and then make me fix them all. :)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUwrolAAoJEBzwKT+lPKRYpTIQAJD4NAaq80fahfCF5bqVjO2h
kiEo++RACuq3eLTEVp5lwaZ/O7Gt9wquKCqki0x3Su0nX+Cu3MjZ4skIe+CD//kO
8bxFRB13ZDDu3s40VTZ1jJ8M0Hxx4ARyBPO2mj4a4lhHkv0UHDUahPIisf49mAE3
LCxnT2arN/FS3vBoo2zi7i637aZT3w4PxVovPxpc8rW0GuMl5oOm6ynGl5q0V659
C2iG1+WuxEH9Y3T4sPCmYPeKMo6lztKenOgEhlBuVB2ogAzIaagujfmBkx64dric
fEO9eIWq9w9aIUCBmVlA+4jfI4WtpITRVAT4kB+ksbkj2CPF25/iJMkb36UcPh5p
4DFaC3XmylgJXhU2s6nzrqoFJg5L1ysDq0LsryWAzN4w2a7Z4QJfhehxTulf8tdi
I2C0sjEVPT3h9E8zfhuvBD6r6NkVwvPUcFDOaBXBhbSGjAUSxshgVuyLYFFcOkeF
M/KlatcL48suHO5T4aU7UDbQSVDjjysVGmBQGs7L0RCZ6wS/XUUMlmPig1xxQpDu
5tjOy8L2dUiBbBbt8C8E9MOhtxF17Q1a59GGUqLuCLWis4+I9W0VRPn99E6nGCi8
N9xLfZCCwuTRXP185rPMpeafmIgt5Ld3ijTPny2A9ccT81nYpDVmN8Vqold/4Nrr
DC9vWAHHFIi4z6v8tA7V
=iWRL
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by David kerber <dc...@verizon.net>.
On 1/23/2015 5:04 AM, André Warnier wrote:
> A part of what I wanted to say in my original answer, is that just by
> taking the time to actually think about the problem you are having, and
> writing down a clear explanation for someone else, you often find the
> solution yourself.

Add in the exercise of boiling the code or page down to minimum 
necessary to exhibit the problem, and I have found my own fixes while 
preparing to post a question, too many times to count.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by André Warnier <aw...@ice-sa.com>.
Hi Prabhu Mannu.
Answer below.

Prabhu Mannu wrote:
> Hi all/ Dear André Warnier,
> 
> I understand that I cannot ask questions or help without actually telling
> what I did so resolve the issue in the first place.
> 
> Initially I followed this
> http://wiki.apache.org/tomcat/FAQ/CharacterEncoding
> 
> I wanted to get the minimal setting which would help, some of the things I
> found is that few of the jsp pages itself was encoded differently and not
> utf-8 and once I fixed that it do not completely worked. 
> 
> After lots of trial and error,  Two  settings which worked for me are by
> adding contenttype tag in  jsp page
> <%@ page contentType="text/html; charset=UTF-8" %>
> And in server.xml
> <Connector connectionTimeout="20000" port="8089" protocol="HTTP/1.1"
> redirectPort="8443" URIEncoding="UTF-8" />
> 
> Before changes to config
> prabhu@dev01 ~
> $ curl -I http://localhost:8088/xxxx/user/index.action
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Set-Cookie: JSESSIONID=5CB483D8DC5F2C574DBDDE1E102763EC; Path=/xxxxx/;
> HttpOnly
> Content-Type: text/html;charset=ISO-8859-1
> Content-Length: 3863
> Date: Fri, 23 Jan 2015 09:14:43 GMT
> 
> After changes to config
> prabhu@dev01 ~
> $ curl -I http://localhost:8088/ xxxx /user/index.action
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Set-Cookie: JSESSIONID=7CBEAE0ACCEB65FAF92CF6D94BF0FEDD; Path=/ xxxx /;
> HttpOnly
> Content-Type: text/html;charset=UTF-8
> Content-Length: 3868
> Date: Fri, 23 Jan 2015 09:15:12 GMT
> 
> 
> With regards
> Prabhu 
> 

My original answer was meant to be somewhat humoristic.
But that does not mean that your question to the list was "noob".
It was actually a good question, and a good explanation of your problem.
Bonus points for that.
That you found the solution yourself afterward, and communicated this to the list, are two 
additional bonus points.
A part of what I wanted to say in my original answer, is that just by taking the time to 
actually think about the problem you are having, and writing down a clear explanation for 
someone else, you often find the solution yourself.
Many people do not take that time, and fire incomplete and confusing messages to the list, 
which is not your case.

Some data about your original issue :

1) when it receives some response content from a webserver, according to the HTTP RFC's, a 
browser is supposed to (MUST) "believe" the content-type that the webserver is sending 
along with the response (in the "Content-type" header).
Not all browsers do that correctly.  Older versions of IE ignore this requirement, and try 
to figure out the content themselves.  That is not good and often brings problems.

2) when the webserver does not send a Content-type header, then (and only then) the 
browser is allowed to "guess", based on inspecting the content.

3) when your application specifies the content-type (such as with the added parameters in 
the jsp tag), then the webserver (Tomcat here), will respect that, and send out the answer 
with a corresponding Content-type header.  And then also a respectful browser will respect 
this too, and display the page in the correct character set.

4) when your application does not specify a content-type, then the webserver also 
"guesses" before sending out the response to the browser.  And. beause the standard 
default charset of the HTTP 1.1 protocol is still "iso-8859-1", that is what the webserver 
guesses (wrongly) in this case. (Your first example of curl above).

Morality : in web applications, always specify the content-type (and character set, if 
applicable) of what you are returning.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by Prabhu Mannu <pr...@fernridge.com>.
Hi all/ Dear André Warnier,

I understand that I cannot ask questions or help without actually telling
what I did so resolve the issue in the first place.

Initially I followed this
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding

I wanted to get the minimal setting which would help, some of the things I
found is that few of the jsp pages itself was encoded differently and not
utf-8 and once I fixed that it do not completely worked. 

After lots of trial and error,  Two  settings which worked for me are by
adding contenttype tag in  jsp page
<%@ page contentType="text/html; charset=UTF-8" %>
And in server.xml
<Connector connectionTimeout="20000" port="8089" protocol="HTTP/1.1"
redirectPort="8443" URIEncoding="UTF-8" />

Before changes to config
prabhu@dev01 ~
$ curl -I http://localhost:8088/xxxx/user/index.action
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=5CB483D8DC5F2C574DBDDE1E102763EC; Path=/xxxxx/;
HttpOnly
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 3863
Date: Fri, 23 Jan 2015 09:14:43 GMT

After changes to config
prabhu@dev01 ~
$ curl -I http://localhost:8088/ xxxx /user/index.action
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=7CBEAE0ACCEB65FAF92CF6D94BF0FEDD; Path=/ xxxx /;
HttpOnly
Content-Type: text/html;charset=UTF-8
Content-Length: 3868
Date: Fri, 23 Jan 2015 09:15:12 GMT


With regards
Prabhu 

-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: Friday, 23 January, 2015 4:10 PM
To: Tomcat Users List
Subject: Re: Tomcat 8 encoding issues: unable to change the default encoding
iso-8859-1 to utf-8 in http header

Prabhu Mannu wrote:
> Hi all,
> 
> Found the issue it's the jsp page itself that was encoded in 
> iso-8859-1 format.
> Sighs ...... I became such a noob.
> Sorry all for the trouble.
> 
> With regards
> Prabhu

No problem.
That is one reason why this Tomcat Users list is great and unique on the www
: just the fact of writing to it, describing your issue clearly and
concisely, automatically gives you the solution, without anyone even having
to lift a finger.


> -----Original Message-----
> From: Prabhu Mannu [mailto:prabhu@fernridge.com]
> Sent: Friday, 23 January, 2015 3:21 PM
> To: users@tomcat.apache.org
> Subject: Tomcat 8 encoding issues: unable to change the default 
> encoding
> iso-8859-1 to utf-8 in http header
> 
> Hi all,
> 
> Firs off Sorry if this question appears too noob.
> 
> Currently in my application I get this warning.
> HTML1114: Codepage iso-8859-1 from (HTTP header) overrides conflicting 
> codepage utf-8 from (META tag)
> File: index.action
> 
> Application uses struts 2, spring, hibernate, jpa + tiles 3 framework.
> 
> The application does have this meta tag in all the jsp files <meta 
> charset="utf-8">
> 
> Tomcat version 8 is used
> Server version:        Apache Tomcat/8.0.15
> JVM Version:           1.7.0_51-b13
> JVM Vendor:            Oracle Corporation
> 
> Also have as java parameters
> -Dfile.encoding=UTF-8 and
> -Djavax.servlet.request.encoding=UTF-8
> 
> 
> In server.xml
> <Connector connectionTimeout="20000" port="8089" protocol="HTTP/1.1"
> redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true" 
> />
> 
> In web.xml in conf folder
>     <filter>
>         <filter-name>setCharacterEncodingFilter</filter-name>
>  
> <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</
> filter
> -class>
>         <init-param>
>             <param-name>encoding</param-name>
>             <param-value>UTF-8</param-value>
>         </init-param>
>         <async-supported>true</async-supported>
>     </filter>
> <filter-mapping>
>         <filter-name>setCharacterEncodingFilter</filter-name>
>         <url-pattern>/*</url-pattern>
>     </filter-mapping>
> 
> In web.xml of the application
> <jsp-config>
>         <jsp-property-group>
>             <url-pattern>*.jsp</url-pattern>
>             <page-encoding>UTF-8</page-encoding>
>             <trim-directive-whitespaces>true</trim-directive-whitespaces>
>         </jsp-property-group>
>     </jsp-config>
> 
> <filter>
>   <filter-name>setCharacterEncodingFilter</filter-name>
>  
> <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</
> filter
> -class>
>   <init-param>
>    <param-name>encoding</param-name>
>    <param-value>UTF-8</param-value>
>   </init-param>
>  </filter>
> <filter-mapping>
>   <filter-name>setCharacterEncodingFilter</filter-name>
>   <url-pattern>/*</url-pattern>
>  </filter-mapping>
> 
> But I still get this warning
> Codepage iso-8859-1 from (HTTP header) overrides conflicting codepage 
> utf-8 from (META tag)
> 
> 
> I tried to move/change the order of the filters for setting encoding 
> but doesn't seem to make any difference.
> 
> I cannot figure out what is wrong and why the http header is saying
> iso-8859-1 encoding instead of utf-8. I need utf-8 cause this 
> application need to support Japanese language.
> 
> I welcome anyone to give me any suggestion/comments/or pointers on 
> what I am doing wrong.
> 
> With regards
> Prabhu
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by André Warnier <aw...@ice-sa.com>.
Prabhu Mannu wrote:
> Hi all,
> 
> Found the issue it's the jsp page itself that was encoded in iso-8859-1
> format.
> Sighs ...... I became such a noob.
> Sorry all for the trouble.
> 
> With regards
> Prabhu 

No problem.
That is one reason why this Tomcat Users list is great and unique on the www : just the 
fact of writing to it, describing your issue clearly and concisely, automatically gives 
you the solution, without anyone even having to lift a finger.


> -----Original Message-----
> From: Prabhu Mannu [mailto:prabhu@fernridge.com] 
> Sent: Friday, 23 January, 2015 3:21 PM
> To: users@tomcat.apache.org
> Subject: Tomcat 8 encoding issues: unable to change the default encoding
> iso-8859-1 to utf-8 in http header 
> 
> Hi all,
> 
> Firs off Sorry if this question appears too noob.
> 
> Currently in my application I get this warning.
> HTML1114: Codepage iso-8859-1 from (HTTP header) overrides conflicting
> codepage utf-8 from (META tag)
> File: index.action
> 
> Application uses struts 2, spring, hibernate, jpa + tiles 3 framework.
> 
> The application does have this meta tag in all the jsp files <meta
> charset="utf-8">
> 
> Tomcat version 8 is used
> Server version:        Apache Tomcat/8.0.15
> JVM Version:           1.7.0_51-b13
> JVM Vendor:            Oracle Corporation
> 
> Also have as java parameters
> -Dfile.encoding=UTF-8 and
> -Djavax.servlet.request.encoding=UTF-8
> 
> 
> In server.xml
> <Connector connectionTimeout="20000" port="8089" protocol="HTTP/1.1"
> redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true" />
> 
> In web.xml in conf folder
>     <filter>
>         <filter-name>setCharacterEncodingFilter</filter-name>
>  
> <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter
> -class>
>         <init-param>
>             <param-name>encoding</param-name>
>             <param-value>UTF-8</param-value>
>         </init-param>
>         <async-supported>true</async-supported>
>     </filter>
> <filter-mapping>
>         <filter-name>setCharacterEncodingFilter</filter-name>
>         <url-pattern>/*</url-pattern>
>     </filter-mapping>
> 
> In web.xml of the application
> <jsp-config>
>         <jsp-property-group>
>             <url-pattern>*.jsp</url-pattern>
>             <page-encoding>UTF-8</page-encoding>
>             <trim-directive-whitespaces>true</trim-directive-whitespaces>
>         </jsp-property-group>
>     </jsp-config>
> 
> <filter>
>   <filter-name>setCharacterEncodingFilter</filter-name>
>  
> <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter
> -class>
>   <init-param>
>    <param-name>encoding</param-name>
>    <param-value>UTF-8</param-value>
>   </init-param>
>  </filter>
> <filter-mapping>
>   <filter-name>setCharacterEncodingFilter</filter-name>
>   <url-pattern>/*</url-pattern>
>  </filter-mapping>
> 
> But I still get this warning
> Codepage iso-8859-1 from (HTTP header) overrides conflicting codepage utf-8
> from (META tag)
> 
> 
> I tried to move/change the order of the filters for setting encoding but
> doesn't seem to make any difference.
> 
> I cannot figure out what is wrong and why the http header is saying
> iso-8859-1 encoding instead of utf-8. I need utf-8 cause this application
> need to support Japanese language.
> 
> I welcome anyone to give me any suggestion/comments/or pointers on what I am
> doing wrong.
> 
> With regards
> Prabhu 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat 8 encoding issues: unable to change the default encoding iso-8859-1 to utf-8 in http header

Posted by Prabhu Mannu <pr...@fernridge.com>.
Hi all,

Found the issue it's the jsp page itself that was encoded in iso-8859-1
format.
Sighs ...... I became such a noob.
Sorry all for the trouble.

With regards
Prabhu 
-----Original Message-----
From: Prabhu Mannu [mailto:prabhu@fernridge.com] 
Sent: Friday, 23 January, 2015 3:21 PM
To: users@tomcat.apache.org
Subject: Tomcat 8 encoding issues: unable to change the default encoding
iso-8859-1 to utf-8 in http header 

Hi all,

Firs off Sorry if this question appears too noob.

Currently in my application I get this warning.
HTML1114: Codepage iso-8859-1 from (HTTP header) overrides conflicting
codepage utf-8 from (META tag)
File: index.action

Application uses struts 2, spring, hibernate, jpa + tiles 3 framework.

The application does have this meta tag in all the jsp files <meta
charset="utf-8">

Tomcat version 8 is used
Server version:        Apache Tomcat/8.0.15
JVM Version:           1.7.0_51-b13
JVM Vendor:            Oracle Corporation

Also have as java parameters
-Dfile.encoding=UTF-8 and
-Djavax.servlet.request.encoding=UTF-8


In server.xml
<Connector connectionTimeout="20000" port="8089" protocol="HTTP/1.1"
redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true" />

In web.xml in conf folder
    <filter>
        <filter-name>setCharacterEncodingFilter</filter-name>
 
<filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter
-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <async-supported>true</async-supported>
    </filter>
<filter-mapping>
        <filter-name>setCharacterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

In web.xml of the application
<jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <page-encoding>UTF-8</page-encoding>
            <trim-directive-whitespaces>true</trim-directive-whitespaces>
        </jsp-property-group>
    </jsp-config>

<filter>
  <filter-name>setCharacterEncodingFilter</filter-name>
 
<filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter
-class>
  <init-param>
   <param-name>encoding</param-name>
   <param-value>UTF-8</param-value>
  </init-param>
 </filter>
<filter-mapping>
  <filter-name>setCharacterEncodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

But I still get this warning
Codepage iso-8859-1 from (HTTP header) overrides conflicting codepage utf-8
from (META tag)


I tried to move/change the order of the filters for setting encoding but
doesn't seem to make any difference.

I cannot figure out what is wrong and why the http header is saying
iso-8859-1 encoding instead of utf-8. I need utf-8 cause this application
need to support Japanese language.

I welcome anyone to give me any suggestion/comments/or pointers on what I am
doing wrong.

With regards
Prabhu 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org