Bugs item #1035881, was opened at 2004-09-28 10:37
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1035881&group_id=61302

Category: None
Group: Release 1.2
Status: Open
Resolution: None
Priority: 5
Submitted By: bob yuan (bobyuan)
Assigned to: Nobody/Anonymous (nobody)
Summary: Page encoding bug.

Initial Comment:
A constructor for 
class "net.sourceforge.jwebunit.HttpUnitDialog" should 
be modified to support webpages that are not encoded 
in ISO8859-1. 
 
I have fixed that problem by replacing default encoding 
scheme ISO8859-1 with the charset definition found in 
webpage, see code below:

 /**
  * Begin a dialog with an initial URL and test client 
context.
  * 
  * @param initialURL
  *            absolute url at which to begin dialog.
  * @param context
  *            contains context information for the test 
client.
  */
 public HttpUnitDialog(String initialURL, TestContext 
context) {
  this.context = context;
  initWebClient();
  try {
   resp = wc.getResponse(new GetMethodWebRequest
(initialURL));
            
            // Replace page encoding scheme in 
           //  context boject (see above) 
            // by webpage prefered character set. 
            String pageEncoding = resp.getCharacterSet();
            if ((pageEncoding != null && 
pageEncoding.length() > 0)) {
                this.context.setEncodingScheme
(pageEncoding);
            }
  } catch (Exception e) {
   throw new RuntimeException
(ExceptionUtility.stackTraceToString(e));
  }
 }

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1035881&group_id=61302


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Jwebunit-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to