如何处理BIRT直接读取mysql4.0 iso8859_1乱码问题

这篇文章将为大家详细讲解有关如何处理BIRT直接读取mysql4.0 iso8859_1乱码问题,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

修改birt源码

[@more@]

package org.eclipse.birt.core.format;


public class StringFormatter{

......

public String format( String str )
{
 if ( trim && str != null )
 {

str = str.trim( );
 }
 
 try{
  str = new String(str.getBytes("ISO8859_1"),"GBK");
 }catch (Exception e){
  e.printStackTrace();
 }

 
 if ( formatPattern.equals( "Unformatted" ) ){ //$NON-NLS-1$

return str;
 }

关于“如何处理BIRT直接读取mysql4.0 iso8859_1乱码问题”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。