AW: AW: Transforming a String to valid HTML encoding

2003-01-15 Thread Hirschmann, Bernhard

Thank you for your help, Craig.

I don't know if you got me completely right.. or maybe I didn't understand.

What I want to do is to transform the regional characters of a String like
ü into uuml;

The reason is, that I don't want to use utf-8, but ISO-8859-1 for my html
pages. And if a ü appears in the ISO-8859-1 characterset in the browser,
it is not displayed correctly in a browser using the english locale. But it
is displayed correctly if uuml; is used. (what is the name for this
format?)

As far as I could learn, java.net.URLEncoder transforms into
application/x-www-form-urlencoded MIME format, used for the URLs. But this
format is not for the body of a html page, right?


Regards,
Bernhard


-Ursprüngliche Nachricht-
Von: Craig R. McClanahan
Gesendet: Dienstag, 14. Januar 2003 19:06
An: Struts Users Mailing List
Betreff: Re: AW: Transforming a String to valid HTML encoding

On Tue, 14 Jan 2003, Hirschmann, Bernhard wrote:

 Date: Tue, 14 Jan 2003 17:31:03 +0100
 From: Hirschmann, Bernhard [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: AW: Transforming a String to valid HTML encoding


 I wonder if this problem is too easy or too hard - may please somebody
 comment this?


ResponseUtils is only worried about filtering the characters that could
cause security problems -- it is not designed to be a general purpose URL
encoder.  For that, check out the java.net.URLEncoder class.

 Craig?

 Thank you very much

Craig




 - original message -

 I still have the problem to transform a String containing national special
 characters to the appropriate HTML encoding.

 i.e.: schön  reich -- schouml;n amp reich

 The class org.apache.struts.util.ResponseUtils only transforms the 4
 characters , ,  and  into their html representative.

 Is there another transformer around?

 Any hints highly appreciated.

 Regards,
 Bernhard


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: AW: AW: Transforming a String to valid HTML encoding

2003-01-15 Thread Gemes Tibor
2003. január 15. 10:16 dátummal Hirschmann, Bernhard ezt írtad:
 The reason is, that I don't want to use utf-8, but ISO-8859-1 for my html
 pages. And if a ü appears in the ISO-8859-1 characterset in the browser,

What is wrong with utf-8?

Tib

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




AW: AW: AW: Transforming a String to valid HTML encoding

2003-01-15 Thread Hirschmann, Bernhard

 The reason is, that I don't want to use utf-8, but ISO-8859-1 for my html
 pages. And if a ü appears in the ISO-8859-1 characterset in the
browser,

 What is wrong with utf-8?

Nothing is wrong with utf-8. Maybe it would be the best to use it, even
though everything is much more complex while handling stuff like the html
form entries, which have to be converted.

The main reason is that our customer has problems with its application
server configuration when I deliver JSPs in utf-8. I don't know what kind of
problems, because it is not possible for me to check the configuration - it
is a high security area where they run their servers, and there are reasons
why I'm not allowed to check it. I just deliver and get the bug reports...
So I think I better use the ISO-8859-1 character set with html characters
like amp. It may be stupid, but it eases a lot.

Regards
Bernhard

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: AW: AW: AW: Transforming a String to valid HTML encoding

2003-01-15 Thread Gemes Tibor
2003. január 15. 10:52 dátummal Hirschmann, Bernhard ezt írtad:
  The reason is, that I don't want to use utf-8, but ISO-8859-1 for my
  html pages. And if a ü appears in the ISO-8859-1 characterset in the

 browser,

  What is wrong with utf-8?

 Nothing is wrong with utf-8. Maybe it would be the best to use it, even
 though everything is much more complex while handling stuff like the html
 form entries, which have to be converted.

No, as far as you are using the SetCharacterEncoding filter coming with the 
example application of Tomcat.

 reports... So I think I better use the ISO-8859-1 character set with html
 characters like amp. It may be stupid, but it eases a lot.

I use iso-8859-2 if I know that each user input is covered in it. However I 
need to use the abovementioned filter in this case too.

Hth,

Tib

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




AW: AW: AW: AW: Transforming a String to valid HTML encoding

2003-01-15 Thread Hirschmann, Bernhard


 Nothing is wrong with utf-8. Maybe it would be the best to use it, even
 though everything is much more complex while handling stuff like the html
 form entries, which have to be converted.

 No, as far as you are using the SetCharacterEncoding filter coming with
the 
 example application of Tomcat.

I think I have to study this in more detail - it still isn't quite clear for
me. 
What is this SetCharacterEncoding filter doing? Is it only working with
Tomcat? (We use WebSphere 4)

I also have unicode characters from the DB which have to be displayed
correctly. Is this filter good for that? 

Bernhard

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: AW: AW: AW: AW: Transforming a String to valid HTML encoding

2003-01-15 Thread Gemes Tibor
2003. január 15. 11:32 dátummal Hirschmann, Bernhard ezt írtad:

 I think I have to study this in more detail - it still isn't quite clear
 for me.
 What is this SetCharacterEncoding filter doing? Is it only working with
 Tomcat? (We use WebSphere 4)

I don't know websphere, but if it conforms to the servlet specs v2.3 then it 
is.

 I also have unicode characters from the DB which have to be displayed
 correctly. Is this filter good for that?

No. It is for the user submitted data to convert into the proper encoding.

Tib

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: AW: AW: AW: AW: Transforming a String to valid HTML encoding

2003-01-15 Thread Giri Alwar
If I am not mistaken, under Servlet 2.3 spec, you can call the
setCharacterEncoding() method on the request and set it to a desired
encoding before reading any parameters from the request. The container is
responsible for providing you with request parameters in the encoding your
specified from this point on. WAS 4.0 does not support the J2EE 1.3 spec (it
supports 1.2.1). You will need WAS 5.0 for this to work. It is working in
Tomcat because the version of Tomcat you have supports J2EE 1.3.

- Original Message -
From: Gemes Tibor [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 4:46 AM
Subject: Re: AW: AW: AW: AW: Transforming a String to valid HTML encoding


2003. január 15. 11:32 dátummal Hirschmann, Bernhard ezt írtad:

 I think I have to study this in more detail - it still isn't quite clear
 for me.
 What is this SetCharacterEncoding filter doing? Is it only working with
 Tomcat? (We use WebSphere 4)

I don't know websphere, but if it conforms to the servlet specs v2.3 then it
is.

 I also have unicode characters from the DB which have to be displayed
 correctly. Is this filter good for that?

No. It is for the user submitted data to convert into the proper encoding.

Tib

--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 1/1/2003

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: AW: AW: AW: AW: Transforming a String to valid HTML encoding

2003-01-15 Thread Dan Tran
Take a look at this link
http://www.anassina.com/struts/i18n/i18n.html

It has a section dealing with WS4 without using filter

-D
- Original Message -
From: Gemes Tibor [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, January 15, 2003 2:46 AM
Subject: Re: AW: AW: AW: AW: Transforming a String to valid HTML encoding


2003. január 15. 11:32 dátummal Hirschmann, Bernhard ezt írtad:

 I think I have to study this in more detail - it still isn't quite clear
 for me.
 What is this SetCharacterEncoding filter doing? Is it only working with
 Tomcat? (We use WebSphere 4)

I don't know websphere, but if it conforms to the servlet specs v2.3 then it
is.

 I also have unicode characters from the DB which have to be displayed
 correctly. Is this filter good for that?

No. It is for the user submitted data to convert into the proper encoding.

Tib

--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]