jduranmaster / docbkx-tools

Automatically exported from code.google.com/p/docbkx-tools
0 stars 0 forks source link

Builder plugin ignores encoding when generating code #104

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The builder plugin uses the default encoding when generating files during a 
build. When the project contains a source file containing a character that 
cannot be represented in the current system's default character set, the user 
is unable to use the builder plugin.

* If the user does not specify project.build.sourceEncoding in the pom.xml, the 
build will fail when it attempts to compile the file with the unsupported 
character.

* If the user does specify project.build.sourceEncoding, e.g. UTF-8 on a system 
where the default is Cp1252, the builder plugin will generate a source file 
containing the Cp1252-encoded character, and the subsequent compilation will 
fail because the character is not supported in UTF-8.

The attached patch resolves this issue by adhering to the standard Maven 
property project.build.sourceEncoding when generating files during a build.

Original issue reported on code.google.com by samharw...@gmail.com on 21 Aug 2013 at 1:27

Attachments:

GoogleCodeExporter commented 8 years ago
Due to the use of Unicode quotation marks in some source files in this project, 
the builder plugin is completely unusable on non-UTF-8 systems until this is 
corrected (including Windows systems and many international systems).

Original comment by samharw...@gmail.com on 21 Aug 2013 at 1:53

GoogleCodeExporter commented 8 years ago
hello,

instead of  
 Reader reader = new InputStreamReader(in, Charset.forName("UTF-8")); 
I put
 Reader reader = new InputStreamReader(in, Charset.forName(encoding));

is that still ok? as I have no failure I don't know if it makes sens.

Regards,
Cedric

Original comment by MimilO...@gmail.com on 7 Jan 2014 at 5:37

GoogleCodeExporter commented 8 years ago
It builds on windows and linux, but it was also working in the past for me. I 
close the issue and hope it will work on more systems

Original comment by MimilO...@gmail.com on 10 Jan 2014 at 10:57

GoogleCodeExporter commented 8 years ago

Original comment by MimilO...@gmail.com on 19 Jan 2014 at 7:06

GoogleCodeExporter commented 8 years ago

Original comment by MimilO...@gmail.com on 19 Jan 2014 at 7:06

GoogleCodeExporter commented 8 years ago
Sorry about the delay replying.

The file being read by the InputStreamReader is part of the docbkx-tools 
distribution and will always have the UTF-8 encoding. The output is 
independently controlled and may differ from the input encoding.

Original comment by samharw...@gmail.com on 19 Jan 2014 at 10:12