Fix I18n issue.

This commit is contained in:
Paulo Gustavo Veiga 2010-01-19 00:39:52 -03:00
parent 131d5b18e8
commit 2efa40c664
2 changed files with 46 additions and 28 deletions

View File

@ -22,6 +22,7 @@ package com.wisemapping.util;
import java.io.IOException; import java.io.IOException;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.nio.charset.Charset;
import java.util.zip.ZipInputStream; import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
@ -43,7 +44,10 @@ public class ZipUtils {
StringBuffer sb_result = new StringBuffer(); StringBuffer sb_result = new StringBuffer();
while ((len = zipIn.read(buffer)) > 0) { while ((len = zipIn.read(buffer)) > 0) {
sb_result.append(new String(buffer, 0, len));
sb_result.append(new String(buffer, 0, len, Charset.forName("UTF-8")));
} }
zipIn.closeEntry(); zipIn.closeEntry();
@ -57,7 +61,9 @@ public class ZipUtils {
public static byte[] stringToZip(String content) throws IOException { public static byte[] stringToZip(String content) throws IOException {
ZipOutputStream zip = null; ZipOutputStream zip = null;
ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes());
ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes("UTF-8"));
try { try {
zip = new ZipOutputStream(byteArray); zip = new ZipOutputStream(byteArray);

View File

@ -1,10 +1,22 @@
log4j.rootCategory=WARN, stdout log4j.rootLogger=WARN, stdout, R
log4j.net.sf=FATAL,stdout log4j.logger.net.sf=FATAL,stdout, R
log4j.com.wisemapping=DEBUG,stdout log4j.logger.com.wisemapping=WARN,stdout,R
log4j.org.wisemapping.ws=DEBUG,stdout log4j.logger.org.wisemapping.ws= WARN,stdout, R
log4j.logger.org.acegisecurity.event.authentication= FATAL,stdout, R
##log4j.category.net.sf.acegisecurity=DEBUG,
# Stdout logger É
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p %c - %m%n log4j.appender.stdout.layout.ConversionPattern=%d %p %c - %m%n
# File Writter Logger É
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/var/log/tomcat6/wisemapping.log
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %p %c - %m%n