Benjamin Bentmann wrote:
You could of course write an encoding detection plugin which could examine the code and set the required property accordingly.

Personally, I don't see the use case for that. If there are really users out there that don't know what file encoding they are using when writing up
their sources, they are most probably happy with the proposed default value
of Latin-1. Alternatively, this encoding detection plugin could be as simple as printing out the Java system property ${file.encoding} which obviously
worked well enough for the user.

${file.encoding} will only work if the file originated on the same machine.

I think of semi-automatic conversions of inhomogenous code into maven. E.g. some teacher collects homework from his students as a bunch of zip files containing only source, has a script to turn each into a maven project, and a master project interacting with them, like letting them compete with one another or whatever. In this case one might wish to automatically detect the encoding of every module, especially in locales with several commonly used encodings, so that string literals in these classes are handled correctly without the students even knowing what an encoding is.

But that's a corner case, so I guess we should stop discussion about the use of such a program here, until someone actually requires it.

Greetings,
 Martin

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to