Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
csaranta opened this Issue May 13, 2013 · 4 comments

Comments

Projects
None yet
2 participants
@csaranta
Copy link

csaranta commented May 13, 2013

I am using the generator on a database with german names for the database objects. The Java Generator fails to encode special characters like ä,ö,ü. As I see from the sourcecode, no setting is made to output the java classes in UTF-8. This should be easily fixed by using
Writer w = new OutputStreamWriter(new FileOutputStream(textFileName), "UTF8");

@lukaseder

This comment has been minimized.

Copy link
Member

lukaseder commented May 14, 2013

Thanks for reporting this. I'll have a look ASAP

@ghost ghost assigned lukaseder May 14, 2013

@csaranta

This comment has been minimized.

Copy link
Author

csaranta commented May 15, 2013

If starting the JVM with -dfile.encoding UTF8, at least the class names in the java-files are output correctly. But the the filenames still are showing '?' instead of the right character.
Example
Filename should be "Bücher.java" and class shoud be 'Bücher'
if encoding is set to US-ASCII:
Filename is B?cher.java and class-name is B?cher.
if encoding of JVM is set to UTF-8:
Filename is B?cher.java and classname is Bücher.
The reason for this is, that PrintWriter does not report anything when feeded with a character outside the encoding, it just writes a '?' sign.
As to the filename it seems this is a Java-Bug that can be only resolved by preencoding the filename with Unicode-codes "Bücher.java should be "B\u00fccher.java". But to tell the truth, I have not tried it.

@lukaseder

This comment has been minimized.

Copy link
Member

lukaseder commented May 24, 2013

I've added a test view in the H2 integration test database:

CREATE VIEW "Ää" AS
SELECT 1 AS "Öö"

I can partially reproduce the issue using a -Dfile.encoding=US-ASCII argument, i.e. this causes the class to be called ?? within the file. However, I cannot reproduce the problematic file name. On what OS are you running this?

@lukaseder

This comment has been minimized.

Copy link
Member

lukaseder commented Jun 23, 2013

This was partially fixed. Feel free to create a new issue if you find way to reproduce the problematic file name

@lukaseder lukaseder closed this Jun 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.