Roger Ye wrote:
For projects involving developers from different country (i.e. the
developers use different default encodings from one to another), it's a
must
for everyone in the team / project to understand that his/her default
encoding is not the "default" for others
Yes, it would be great if this awareness of encoding differences was in
everybody's head. If you like, grab yourself a POM of a Maven
component/plugin, run "mvn help:effective-pom" on it and search for
"encoding"...
I mean, unless something breaks, people tend to just be happy with the
status quo. Also, not everybody cares about warnings ("Not an error and
works for me, so why bother?").
e.g. I'm from China, I've created
a Maven project, using the my default encoding GBK, and then shared it
with
you, Benjamin, then how would you collaborate with me?
I usually follow the conventions setup by the project owner/leader, so
naturally I tell my IDE (but only my IDE, not my entire OS) to user GBK for
our imaginary joint venture and are fine with editing the sources. The
remaining question is how will my build output look like.
surely you cannot assume the encoding to be iso-8859-xx (your system
default, excuse me if I'm wrong)
Just in case to be clear: Latin-1 was not chosen as the proposed default
value because it happens to be similar with my encoding. It was merely
proposed as a matter of consistency with another plugin that already had
this default value.
Then there are two solutions IMO:
1). we set GBK as source file encoding in pom.xml
2). we don't change pom.xml, but we both use an imaginary-maven-fork which
treats every file as encoded in GBK, this does not be platform-dependent.
as
option b)
will you agree with solution 2)? even if there're 99 developers from China
while only one of you from Germany :P
I'm not sure whether I got your point with solution 2) right: Of course we
shouldn't use some maven-fork, there should only be one Maven. So in either
way, the solution to go for your sketched project is 1), i.e. specify the
encoding GBK in the POM. Otherwise, if we leave the encoding unspecified I
would produce garbage output on my Western machine when building the GBK
encoded sources. The point with the option b) would have just been that
already the Chinese developers would have noticed the requirement to specify
the encoding in the POM, preventing build failures for people outside of
China. Wrong build output is quite a severe illness and should be fixed even
if only a minority of developers experience it.
so, I insist option a)
We have also five more votes for a) over on the wiki, so it seems you need
not worry too much for this coming through ;-)
Benjamin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]