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

Allow system default charset to be overriden #113

Closed
joelittlejohn opened this issue Jun 23, 2013 · 2 comments
Closed

Allow system default charset to be overriden #113

joelittlejohn opened this issue Jun 23, 2013 · 2 comments

Comments

@joelittlejohn
Copy link
Owner

Original author: aud...@gmail.com (June 19, 2013 07:48:26)

What steps will reproduce the problem?

  1. prepare any json schema with utf8 characters in description (ex. ščą)
  2. generate dto through maven plugin
  3. get compilation error: unmappable character for encoding UTF-8

What is the expected output?
.java files encoded in utf-8

What do you see instead?
.java files encoded in ANSI

What version of the tool are you using? On what Java version? (On what
version of Maven/Ant if applicable?)
java 1.6, maven3

Original issue: http://code.google.com/p/jsonschema2pojo/issues/detail?id=113

@joelittlejohn
Copy link
Owner Author

From joelittl...@gmail.com on June 19, 2013 12:52:08
The tool supports UTF-8, but at the moment the CodeModel library being used is defaulting to the system default charset when it generates .java files. Are you using Windows by any chance?

It's quite hard to tell CodeModel what charset to use, but I have done it for other tools and we should definitely support his as a configuration argument.

As a workaround you should be able to work around this by either changing your system default charset to UTF-8, or changing the default charset used by the JVM using:

-Dfile.encoding=UTF8

if you're using Maven (and depending on how you have your project set up) you may need to specify this like:

-DargLine="-Dfile.encoding=UTF8"

@joelittlejohn
Copy link
Owner Author

From aud...@gmail.com on June 19, 2013 14:37:43
yes, i am using windows.
thanks for workaround.

ddcruver added a commit to ddcruver/jsonschema2pojo that referenced this issue Nov 5, 2019
ddcruver added a commit to ddcruver/jsonschema2pojo that referenced this issue Nov 5, 2019
ddcruver added a commit to ddcruver/jsonschema2pojo that referenced this issue Nov 5, 2019
…nd assign them to the RuleFactory through the Jsonschema2Pojo#generate method.
ddcruver added a commit to ddcruver/jsonschema2pojo that referenced this issue Nov 5, 2019
ddcruver added a commit to ddcruver/jsonschema2pojo that referenced this issue Nov 5, 2019
…e all together. Now it adds the correct classpathPrefix to import all libraries from a subdirectory lib which is where copy-dependencies puts them and in general that is good practice if you were to distribute this tool.
ddcruver added a commit to ddcruver/jsonschema2pojo that referenced this issue Nov 5, 2019
ddcruver added a commit to ddcruver/jsonschema2pojo that referenced this issue Nov 5, 2019
joelittlejohn pushed a commit that referenced this issue Nov 19, 2019
* #113 Create RuleLogger interface and implementations.

* #113 Create RuleLogger implementation for each factory and assign them to the RuleFactory through the Jsonschema2Pojo#generate method.

* #113 Move some test dependencies out of the compile scope.

* #113 Fix an issue where script/jar/lib were assumed to be all together. Now it adds the correct classpathPrefix to import all libraries from a subdirectory lib which is where copy-dependencies puts them and in general that is good practice if you were to distribute this tool.

* #113 Add RuleLogger mocking to some tests.

* #113 Add SLF4J binding for gradle plugin tests.

* #1040 Remove explicit scope in test dependencies that are already set to test scope by dependency management.

* #1040 Use slf4j instead of gradle logger

* #1040 Use slf4j instead of gradle logger - fix log statement

* #1040 Move simplelogger.properties to classpath.

* #1040 Try to get CI Build working.

* #1040 Try to get CI Build working. Upgrade Groovy version.

* #1040 Remove pushd/popd to not mess with current working directory.  Added .gitattributes to alwasy checkout shell scripts with linux line endings. Removed .bash version because it really is not needed.

* #1040 Try deleting gradle-2.3-bin to fix org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-2.3-bin.zip problem'.

* #1040 Fix outdated references and spelling errors.

* #1040 Try to get CI Build working.

* #1040 Try to get CI Build working. Using eclipse plugin.

* #1040 Try to get CI Build working. Force it to use https.

* #1040 Switch back to using Gradle framework logger.

* #1040 Try build without to maven builds.

* #1040 Remove switch in AntRuleLogger to address PR comment.

* #1040 Revert changes to jars classpath and scripts to avoid breaking the release.

* #1040 Remove SLFJ from CLI module.

* #1040 Add is enable checks to RuleLogger interface to mimic what SLFJ would provide.  Impelment log level functionality to CLI so it does not get flooded with high verbose logging especially if debug and verbos log levels are used.

* #1040 Fix some instances of hardcoded "UTF-8"

* #1040 Cleanup Travis CI integration since we resolve the Gradle download problem.

* #1040 Convert bat file back to Windows line endings.

* #1040 Add note in description that if print-log-levels option is choosen it will exit after printing log levels.

* #1040 Add Batch files to .gitattributes so it is always treated as CRLF.

* #1040 Remove simplelogger.properties because we are just going to use default configuration for now.

* #1040 Renormalize jsonschema2pojo.bat

* #1040 Remove .gitattributes and revert jsonschema2pojo.bat.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant