[#2461] Generator Encoding Error for Database-Objects with Unicode-Names

This commit is contained in:
Lukas Eder 2013-05-24 19:56:44 +02:00
parent b938123edd
commit 64e48ea499
2 changed files with 6 additions and 3 deletions

View File

@ -36,7 +36,9 @@
package org.jooq.util;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
@ -81,9 +83,9 @@ public abstract class GeneratorWriter<W extends GeneratorWriter<W>> {
this.file = file;
try {
this.writer = new PrintWriter(file);
this.writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
}
catch (FileNotFoundException e) {
catch (IOException e) {
throw new GeneratorException("Error writing " + file.getAbsolutePath());
}
this.sb = new StringBuilder();

View File

@ -29,5 +29,6 @@
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="/org/jooq/configuration/${env_var:USERNAME}/h2/library.xml"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jOOQ-codegen"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dfile.encoding=US-ASCII"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:jOOQ-test}"/>
</launchConfiguration>