Hi!
I'm testing a russian webpage with HttpUnit, but it seems, that it doesn't
support the encoding (Win-1251).
How can I add support for this in Java or HttpUnit?
java.io.Unsuppo rtedEncodingExc eption: WIN-1251
at sun.io.Converte rs.getConverter Class(Converter s.java:114)
at sun.io.Converte rs.newConverter (Converters.jav a:145)
at
sun.io.ByteToCh arConverter.get Converter(ByteT oCharConverter. java:64)
at java.lang.Strin gCoding.decode( StringCoding.ja va:216)
at java.lang.Strin g.<init>(String .java:331)
at java.lang.Strin g.<init>(String .java:359)
at
com.meterware.h ttpunit.WebResp onse.loadRespon seText(WebRespo nse.java:751)
at
com.meterware.h ttpunit.HttpWeb Response.<init> (HttpWebRespons e.java:58)
at
com.meterware.h ttpunit.WebConv ersation.newRes ponse(WebConver sation.java:66)
at com.meterware.h ttpunit.WebClie nt.getResource( WebClient.java: 101)
at com.meterware.h ttpunit.WebClie nt.getResponse( WebClient.java: 82)
at SubmitTest.test MyTest(SubmitTe st.java:46)
at sun.reflect.Nat iveMethodAccess orImpl.invoke0( Native Method)
at
sun.reflect.Nat iveMethodAccess orImpl.invoke(N ativeMethodAcce ssorImpl.java:3 9
)
at
sun.reflect.Del egatingMethodAc cessorImpl.invo ke(DelegatingMe thodAccessorImp l
..java:25)
at java.lang.refle ct.Method.invok e(Method.java:3 24)
at junit.framework .TestCase.runTe st(TestCase.jav a:154)
at junit.framework .TestCase.runBa re(TestCase.jav a:127)
at junit.framework .TestResult$1.p rotect(TestResu lt.java:106)
at junit.framework .TestResult.run Protected(TestR esult.java:124)
at junit.framework .TestResult.run (TestResult.jav a:109)
at junit.framework .TestCase.run(T estCase.java:11 8)
at junit.framework .TestSuite.runT est(TestSuite.j ava:208)
at junit.framework .TestSuite.run( TestSuite.java: 203)
at junit.textui.Te stRunner.doRun( TestRunner.java :116)
at junit.textui.Te stRunner.doRun( TestRunner.java :109)
at junit.textui.Te stRunner.run(Te stRunner.java:7 2)
at SubmitTest.main (SubmitTest.jav a:24)
I'm testing a russian webpage with HttpUnit, but it seems, that it doesn't
support the encoding (Win-1251).
How can I add support for this in Java or HttpUnit?
java.io.Unsuppo rtedEncodingExc eption: WIN-1251
at sun.io.Converte rs.getConverter Class(Converter s.java:114)
at sun.io.Converte rs.newConverter (Converters.jav a:145)
at
sun.io.ByteToCh arConverter.get Converter(ByteT oCharConverter. java:64)
at java.lang.Strin gCoding.decode( StringCoding.ja va:216)
at java.lang.Strin g.<init>(String .java:331)
at java.lang.Strin g.<init>(String .java:359)
at
com.meterware.h ttpunit.WebResp onse.loadRespon seText(WebRespo nse.java:751)
at
com.meterware.h ttpunit.HttpWeb Response.<init> (HttpWebRespons e.java:58)
at
com.meterware.h ttpunit.WebConv ersation.newRes ponse(WebConver sation.java:66)
at com.meterware.h ttpunit.WebClie nt.getResource( WebClient.java: 101)
at com.meterware.h ttpunit.WebClie nt.getResponse( WebClient.java: 82)
at SubmitTest.test MyTest(SubmitTe st.java:46)
at sun.reflect.Nat iveMethodAccess orImpl.invoke0( Native Method)
at
sun.reflect.Nat iveMethodAccess orImpl.invoke(N ativeMethodAcce ssorImpl.java:3 9
)
at
sun.reflect.Del egatingMethodAc cessorImpl.invo ke(DelegatingMe thodAccessorImp l
..java:25)
at java.lang.refle ct.Method.invok e(Method.java:3 24)
at junit.framework .TestCase.runTe st(TestCase.jav a:154)
at junit.framework .TestCase.runBa re(TestCase.jav a:127)
at junit.framework .TestResult$1.p rotect(TestResu lt.java:106)
at junit.framework .TestResult.run Protected(TestR esult.java:124)
at junit.framework .TestResult.run (TestResult.jav a:109)
at junit.framework .TestCase.run(T estCase.java:11 8)
at junit.framework .TestSuite.runT est(TestSuite.j ava:208)
at junit.framework .TestSuite.run( TestSuite.java: 203)
at junit.textui.Te stRunner.doRun( TestRunner.java :116)
at junit.textui.Te stRunner.doRun( TestRunner.java :109)
at junit.textui.Te stRunner.run(Te stRunner.java:7 2)
at SubmitTest.main (SubmitTest.jav a:24)
Comment