Skip to content

Commit

Permalink
change all files "iso-8859-1" to "UTF-8"
Browse files Browse the repository at this point in the history
  • Loading branch information
sdk2 committed Aug 16, 2017
1 parent eb8759d commit 5e79306
Show file tree
Hide file tree
Showing 19 changed files with 77 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* default is used if: BOM mark is not found and defaultEnc is NULL.<br />
*
* Usage pattern:<pre>
* String defaultEnc = "ISO-8859-1"; // or NULL to use system default
* String defaultEnc = "UTF-8"; // or NULL to use system default
* FileInputStream fis = new FileInputStream(file);
* Reader in = new UnicodeReader(fis, defaultEnc);</pre>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private boolean parseFile(File dir, String file) {
FileInputStream fis = new FileInputStream(new File(dir, file));
currentFile = file;
// Create a scanner that reads from the input stream passed to us
CSharpLexer lexer = new CSharpLexer(new UnicodeReader(fis, "ISO-8859-1"));
CSharpLexer lexer = new CSharpLexer(new UnicodeReader(fis, "UTF-8"));
lexer.setFilename(file);
lexer.setTabSize(1);

Expand Down
4 changes: 2 additions & 2 deletions jplag.frontend.java-1.5/src/main/javacc/Java1.5.jj
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ public class JavaParser implements JavaTokenConstants
try {
FileInputStream in = new FileInputStream(new File(dir,fileName));
if (parser == null) {
JavaTabModCharStream charStream = new JavaTabModCharStream(new UnicodeReader(in, "ISO-8859-1"));
JavaTabModCharStream charStream = new JavaTabModCharStream(new UnicodeReader(in, "UTF-8"));
parser = new JavaParser(charStream);
parser.charStream = charStream;
} else {
parser.charStream.ReInit(new UnicodeReader(in, "ISO-8859-1"));
parser.charStream.ReInit(new UnicodeReader(in, "UTF-8"));
parser.ReInit(parser.charStream);
}
parser.parser2 = parserX;
Expand Down
2 changes: 1 addition & 1 deletion jplag.homepage/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
Expand Down
2 changes: 1 addition & 1 deletion jplag/src/main/java/jplag/HTMLFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class HTMLFile extends PrintWriter {
/* This static method has to be used to instanciate HTMLFile objects. */
public static HTMLFile createHTMLFile(File f) throws IOException {
BufferedCounter new_bc = new BufferedCounter(
new OutputStreamWriter(new FileOutputStream(f), "ISO-8859-1"));
new OutputStreamWriter(new FileOutputStream(f), "UTF-8"));
HTMLFile htmlfile = new HTMLFile(new_bc);
htmlfile.bc = new_bc;
// if (Program.verbose_details)
Expand Down
4 changes: 2 additions & 2 deletions jplag/src/main/java/jplag/Report.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ public HTMLFile openHTMLFile(File root, String name) throws ExitException {
public void writeHTMLHeader(HTMLFile file, String title) {
file.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
file.println("<HTML><HEAD><TITLE>" + title + "</TITLE>");
file.println("<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
file.println("<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
file.println("</HEAD>");
}

public void writeHTMLHeaderWithScript(HTMLFile file, String title) {
file.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
file.println("<HTML>\n<HEAD>\n <TITLE>" + title + "</TITLE>");
file.println("<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
file.println("<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
file.println(" <script type=\"text/javascript\">\n <!--");
file.println(" function ZweiFrames(URL1,F1,URL2,F2)\n {");
file.println(" parent.frames[F1].location.href=URL1;");
Expand Down
10 changes: 8 additions & 2 deletions jplag/src/main/java/jplag/Submission.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.FileReader;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.text.DecimalFormat;
import java.util.Vector;
Expand Down Expand Up @@ -81,7 +82,7 @@ private void lookupDir(File dir, String subDir) throws Throwable {
return;
if (readSubDirs) {
String[] dirs = aktDir.list();
if (subDir != "")
if (!subDir.equals(""))
for (int i = 0; i < dirs.length; i++)
lookupDir(dir, subDir + File.separator + dirs[i]);
else
Expand Down Expand Up @@ -214,7 +215,10 @@ public String[][] readFiles(String[] files) throws jplag.ExitException {
for (int i = 0; i < files.length; i++) {
text.removeAllElements();
try {
BufferedReader in = new BufferedReader(new FileReader(new File(dir, files[i])));
/* file encoding = "UTF-8" */
FileInputStream fileInputStream = new FileInputStream(new File(dir, files[i]));
InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");
BufferedReader in = new BufferedReader(inputStreamReader);
while ((help = in.readLine()) != null) {
help = help.replaceAll("&", "&amp;");
help = help.replaceAll("<", "&lt;");
Expand All @@ -223,6 +227,8 @@ public String[][] readFiles(String[] files) throws jplag.ExitException {
text.addElement(help);
}
in.close();
inputStreamReader.close();
fileInputStream.close();
} catch (FileNotFoundException e) {
System.out.println("File not found: " + ((new File(dir, files[i])).toString()));
} catch (IOException e) {
Expand Down
16 changes: 8 additions & 8 deletions jplag/src/main/resources/jplag/data/help-de.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Wie man die Ergebnisse liest</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">
Expand All @@ -11,19 +11,19 @@ <h1>Wie man die Ergebnisse liest</h1>

<p>Das Fenster ist in vier Teile unterteilt:

<p>Die beiden unteren Teile enthalten die Programme, wobei ähnliche Abschnitte
<p>Die beiden unteren Teile enthalten die Programme, wobei ähnliche Abschnitte
mit der selben Farbe markiert sind und durch <img src="forward.gif"
alt="Vorwärts"> oder <img src="back.gif" alt="Rückwärts"> auf die jeweilige
alt="Vorwärts"> oder <img src="back.gif" alt="Rückwärts"> auf die jeweilige
Stelle im anderen Programm verwiesen wird. Klickt man auf diese Bilder,
springen die anderen Ansichten zu den entsprechenden Stellen.<br>
Wurde zu einem Block kein ähnlicher Abschnitt im anderen Programm gefunden, so
Wurde zu einem Block kein ähnlicher Abschnitt im anderen Programm gefunden, so
wird dieser Block schwarz dargestellt.

<p>Der linke obere Teil zeigt die prozentuale Ähnlichkeit zwischen den beiden
<p>Der linke obere Teil zeigt die prozentuale Ähnlichkeit zwischen den beiden
Programmen und bietet Verweise zur Index-Seite und zu dieser Hilfe-Seite an.

<p>Zuletzt enthält der rechte obere Teil eine Tabelle aller Abschnitte, zu denen
ähnliche Abschnitte gefunden wurden. Dabei hat die Tabelle folgendes Format:
<p>Zuletzt enthält der rechte obere Teil eine Tabelle aller Abschnitte, zu denen
ähnliche Abschnitte gefunden wurden. Dabei hat die Tabelle folgendes Format:

<p><TABLE BORDER="1" CELLSPACING="0" BGCOLOR="#d0d0d0">
<TR><TH><TH>Programm_1 (??%)<TH>Programm_2 (??%)<TH>Meta-Zeichen
Expand All @@ -36,7 +36,7 @@ <h1>Wie man die Ergebnisse liest</h1>
</TABLE>

<p>Jede Zeile gibt einen Bereich von Dateizeilen an, die als gleich zu
betrachten sind, zusammen mit der Größe der Abschnitte in Meta-Zeichen.
betrachten sind, zusammen mit der Größe der Abschnitte in Meta-Zeichen.
Die Dateinamen sind wiederum Verweise auf die entsprechenden
Stellen in beiden Programmen, die in der Farbe des kleinen Rechtecks dargestellt
werden.
Expand Down
2 changes: 1 addition & 1 deletion jplag/src/main/resources/jplag/data/help-en.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>How to read the results</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">
Expand Down
28 changes: 14 additions & 14 deletions jplag/src/main/resources/jplag/data/help-es.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Cómo leer los resultados</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<HTML><HEAD><TITLE>Cómo leer los resultados</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">

<center><IMG SRC="logo.gif" ALT="JPlag" BORDER="0"></center>

<h1>Cómo leer los resultados</h1>
<h1>Cómo leer los resultados</h1>

<p>La ventana se encuentra dividida en cuatro marcos:

<p>Los dos marcos grandes en el fondo contienen las solicitudes en las
cuales los parrafos similares están marcados con el mismo color. El texto
negro significa que no se encontró ninguna parte que coincidiese con la
otra solicitud. Además, cada parrafo tiene asociado <img src="forward.gif" alt="Adelante"> o
<img src="back.gif" alt="Atrás">. Pulsar sobre estos iconos lleva el foco en el
cuales los parrafos similares están marcados con el mismo color. El texto
negro significa que no se encontró ninguna parte que coincidiese con la
otra solicitud. Además, cada parrafo tiene asociado <img src="forward.gif" alt="Adelante"> o
<img src="back.gif" alt="Atrás">. Pulsar sobre estos iconos lleva el foco en el
otro marco del programa al pasaje que coincida realiza un scroll en la tabla
a lo alto de la otra posición.
a lo alto de la otra posición.

<p>El marco izquierdo en la parte superior muestra el porcentaje de la
semejanza entre los dos programas y proporciona links al inicio
y a la página estás leyendo ahora.
y a la página estás leyendo ahora.

<p>El marco de la derecha contiene una tabla de todos los pasajes que
coinciden. La tabla tiene el siguiente formato:

<p><TABLE BORDER="1" CELLSPACING="0" BGCOLOR="#d0d0d0">
<TR><TH><TH>Solicitud1 (??%)<TH>Solicitud2 (??%)<TH>Símbolos
<TR><TH><TH>Solicitud1 (??%)<TH>Solicitud2 (??%)<TH>Símbolos
<TR><TD BGCOLOR="#c00000"><FONT COLOR="#c00000">-</FONT><TD>
<A HREF="">archivo1 (1-8)</a><TD><A HREF="">archivo2 (1-10)</A>
<TD ALIGN=center><FONT COLOR="#b00000">23</FONT>
Expand All @@ -36,13 +36,13 @@
<TD ALIGN=center><FONT COLOR="#600000">11</FONT>
</TABLE>

<p>Cada línea proporciona un rango de números de línea del archivo1 y
el archivo2 que son consideradas iguales, junto con el tamaño del
pasaje en símbolos.
<p>Cada línea proporciona un rango de números de línea del archivo1 y
el archivo2 que son consideradas iguales, junto con el tamaño del
pasaje en símbolos.

Los nombres de archivos son hyperlinks al parrafo apropiado en ambos programas.

El parrafo tiene el color del rectángulo pequeño en el borde izquierdo de la fila.
El parrafo tiene el color del rectángulo pequeño en el borde izquierdo de la fila.

<p><a href="index.html">INDICE</a>
<p>
Expand Down
2 changes: 1 addition & 1 deletion jplag/src/main/resources/jplag/data/help-fr.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>How to read the results</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">
Expand Down
2 changes: 1 addition & 1 deletion jplag/src/main/resources/jplag/data/help-pt.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>How to read the results</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">
Expand Down
26 changes: 13 additions & 13 deletions jplag/src/main/resources/jplag/data/help-ptbr.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<title>Como ler os resultados</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" link="#000088" text="#000000" vlink="#000000">
<center><img src="logo.gif" alt="JPlag" border="0"></center>
Expand All @@ -14,19 +14,19 @@ <h1>Como ler os resultados</h1>
trechos similares est&atilde;o marcados com a mesma cor. Texto preto
significa que n&atilde;o foi encontrado algum trecho equivalente em
outro arquivo submetido.<br>
&nbsp; Todo trecho com alguma equivalência encontrada
&nbsp; Todo trecho com alguma equivalência encontrada
tem um <img src="forward.gif" alt="Forward">
ou
<img src="back.gif" alt="Backward"> associado. Clicando nesses icones, o
foco vai para outro bloco com o trecho equivalente já na posição apropriada.
foco vai para outro bloco com o trecho equivalente já na posição apropriada.
</p>
<p>O bloco da esquerda mostra a porcentagem de similaridade entre
dois programas e possui links para a página inicial e para o código
que você estava vendo.
dois programas e possui links para a página inicial e para o código
que você estava vendo.

</p>
<p>
O bloco da direita contém uma tabela de todos os trechos equivalentes encontrados.
O bloco da direita contém uma tabela de todos os trechos equivalentes encontrados.
A tabela tem o seguinte formato:
</p>
<p>
Expand All @@ -35,9 +35,9 @@ <h1>Como ler os resultados</h1>
<tr>
<th><br>
</th>
<th>Submissão1 (??%)</th>
<th>Submissão2 (??%)</th>
<th>Marcação
<th>Submissão1 (??%)</th>
<th>Submissão2 (??%)</th>
<th>Marcação
</th>
</tr>
<tr>
Expand All @@ -59,11 +59,11 @@ <h1>Como ler os resultados</h1>
</tbody>
</table>
</p>
<p> Cada coluna mostra uma sequência de números de linhas do arquivo1 e arquivo 2 que
são consideradas equivalentes, juntamente com o tamanho do trecho em
marcações. Os nomes dos arquivos são um hiperlink para o trecho apropriado em
<p> Cada coluna mostra uma sequência de números de linhas do arquivo1 e arquivo 2 que
são consideradas equivalentes, juntamente com o tamanho do trecho em
marcações. Os nomes dos arquivos são um hiperlink para o trecho apropriado em
ambos os programas.
O trecho tem a cor de um pequeno retângulo na fronteira esquerda da coluna.
O trecho tem a cor de um pequeno retângulo na fronteira esquerda da coluna.
</p>
<p><a href="index.html">INDEX</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion jplag/src/main/resources/jplag/data/help-sim-de.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Match ranking</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">
Expand Down
2 changes: 1 addition & 1 deletion jplag/src/main/resources/jplag/data/help-sim-en.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Match ranking</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">
Expand Down
16 changes: 8 additions & 8 deletions jplag/src/main/resources/jplag/data/help-sim-es.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Ranking de Coincidencias</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">
Expand All @@ -11,23 +11,23 @@ <h1>Ranking de coincidencias</h1>

<p>JPlag compara los programas intentando cubrir uno de los programas
con secuencias (preferiblemente grandes) del otro programa. La cobertura
de un programa se define como la proporción del código de fuente frente
al tamaño total del código de fuente.</p>
de un programa se define como la proporción del código de fuente frente
al tamaño total del código de fuente.</p>

<h4>Rango de coincidencias por semejanza media</h4>

<p>La semejanza media se define como la media de la cobertura de
ambos programas.<br/>

Esta es la semejanza por defecto que funciona en la mayoría de los casos: Las
Esta es la semejanza por defecto que funciona en la mayoría de los casos: Las
coincidencias con una alta semajanza media indica que esos programas funcionan
de una forma muy similar.</b>

<h4>Rango de coincidencias por semjanza máxima</h4>
<h4>Rango de coincidencias por semjanza máxima</h4>

<p>La semejanza máxima se define como la mayor de ambas coberturas del programa.<br/>
Este ranking es especialmente útil en programas que son muy diferentes en tamaño. Esto
se puede manifestar cuando se introducen grandes porciones de código dentro de uno de ellos
<p>La semejanza máxima se define como la mayor de ambas coberturas del programa.<br/>
Este ranking es especialmente útil en programas que son muy diferentes en tamaño. Esto
se puede manifestar cuando se introducen grandes porciones de código dentro de uno de ellos
para que no se distinga respecto al programa plagiado.</p>

<p><a href="index.html">INDEX</a></p>
Expand Down
2 changes: 1 addition & 1 deletion jplag/src/main/resources/jplag/data/help-sim-fr.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Match ranking</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">
Expand Down
2 changes: 1 addition & 1 deletion jplag/src/main/resources/jplag/data/help-sim-pt.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Match ranking</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#000088" VLINK="#000000" TEXT="#000000">
Expand Down
Loading

0 comments on commit 5e79306

Please sign in to comment.