I have a maven project, the character encoding is set as UTF-8 in my parent pom.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
But in the Java file, some characters like ` or
has been used and it is causing compilation error to me.
In the Eclipse (Properties----Resource -----Text File encoding and Windows--preferences---workspace---text file encoding), I have specified the encoding as UTF-8. Please let me know how this issue can be solved.
PERL CODE TO DO CONVERSION STUFF
use strict;
use warnings;
use File::Find;
use open qw/:std :utf8/;
my $dir = "D:\\files";
find({ wanted => \&collectFiles}, "$dir");
sub collectFiles {
my $filename = $_;
if($filename =~ /.java$/){
#print $filename."\n";
startConversion($filename);
}
}
sub startConversion{
my $filename = $_;
print $filename."\n";
open(my $INFILE, '<:encoding(cp1252)', $filename) or die $!;
open(my $OUTFILE, '>:encoding(UTF-8)', $filename) or die $!;
}