Re: UTF encoding error
От | Felipe Schnack |
---|---|
Тема | Re: UTF encoding error |
Дата | |
Msg-id | 1039024721.1264.6.camel@desenv1.ritterdosreis.br обсуждение исходный текст |
Ответ на | Re: UTF encoding error (Fernando Nasser <fnasser@redhat.com>) |
Список | pgsql-jdbc |
I was with serious problems with brazilian portuguese... and I have no idea how to tell the postmaster to use pt-br... but now I added "&charSet=LATIN1" to my jdbc URLS.. what else I could do? On Wed, 2002-12-04 at 15:53, Fernando Nasser wrote: > Oi Felipe, > > The code in the driver is straight forward so the only way you can get one of > those is that the string sent by the backend is encoded wrong. (I guess we will > have to catch this error and give a better message anyway). > > As of 7.3, the backend does the conversion between your encoding (databse > encoding) and UNICODE (client encoding set with "set client_encoding = > 'UNICODE';") and sends everything as UTF8 to the driver. If the stream of bytes > send has something wrong and says that there is a 3 byte sequence and only two > are there we could get this exception. But this means that the conversion was > made wrong in the backend. > > Have you initialized your cluster with -E ? Isn't it possible that you did not > tell the backend that it is supposed to work with Brazilian Portuguese and > loaded some encoded data there using some binary form? > > Cheers, > Fernando > > > > Felipe Schnack wrote:> I'm getting this error, I'm pretty sure it's a driver > error, but can't > > imagine why... I'm just fetching string (in br-pt language) > > > > java.lang.ArrayIndexOutOfBoundsException: 15 > > at org.postgresql.core.Encoding.decodeUTF8(Encoding.java:254) > > at org.postgresql.core.Encoding.decode(Encoding.java:165) > > at org.postgresql.core.Encoding.decode(Encoding.java:181) > > at > > org.postgresql.jdbc1.AbstractJdbc1ResultSet.getString(AbstractJdbc1ResultSet.java:97) > > at > > org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java) > > at com.w2.infra.db.CtlDatabase.getField(CtlDatabase.java:60) > > at com.w2.infra.mvc.CtlModel.importResultRow(CtlModel.java:48) > > at com.w2.infra.db.DbVector.getLinkedList(DbVector.java:310) > > at com.w2.infra.db.CachedVector.<init>(CachedVector.java:48) > > at com.w2.infra.tags.CtlInvokerTag.doEnd(CtlInvokerTag.java:87) > > at com.w2.infra.tags.BodyTagLib.doEndTag(BodyTagLib.java:86) > > at > > org.apache.jsp.questionariocopia_jsp._jspx_meth_w2_invoker_0(questionariocopia_jsp.java:158) > > at > > org.apache.jsp.questionariocopia_jsp._jspService(questionariocopia_jsp.java:64) > > at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java) > > at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source) > > at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source) > > at org.apache.jasper.servlet.JspServlet.service(Unknown Source) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java) > > at > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown > > Source) > > at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown > > Source) > > at > > com.w2.infra.servlets.ErrorPageFilter.doFilter(ErrorPageFilter.java:25) > > at > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown > > Source) > > at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown > > Source) > > at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source) > > at > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source) > > at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) > > at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) > > at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source) > > at > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source) > > at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) > > at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) > > at org.apache.catalina.core.StandardContext.invoke(Unknown Source) > > at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source) > > at > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source) > > at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown > > Source) > > at > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source) > > at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source) > > at > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source) > > at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) > > at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) > > at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source) > > at > > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source) > > at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) > > at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) > > at > > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) > > at > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405) > > at > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380) > > at > > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508) > > at > > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533) > > at java.lang.Thread.run(Thread.java:536) > > > > > > > > -- > Fernando Nasser > Red Hat - Toronto E-Mail: fnasser@redhat.com > 2323 Yonge Street, Suite #300 > Toronto, Ontario M4P 2C9 > -- Felipe Schnack Analista de Sistemas felipes@ritterdosreis.br Cel.: (51)91287530 Linux Counter #281893 Faculdade Ritter dos Reis www.ritterdosreis.br felipes@ritterdosreis.br Fone/Fax.: (51)32303328
В списке pgsql-jdbc по дате отправления: