Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPlag viewer displaying strange characters #2110

Closed
muety opened this issue Dec 18, 2024 · 5 comments · Fixed by #2118
Closed

JPlag viewer displaying strange characters #2110

muety opened this issue Dec 18, 2024 · 5 comments · Fixed by #2118

Comments

@muety
Copy link

muety commented Dec 18, 2024

Original code:

// [...]
		    /**
		     * Gibt eine einzelne Ziffer einer Zahl anhand eines Index zurueck.
		     * 
		     * @param number
		     * @param index
		     * @return Die Ziffer von der Zahl 'number' an dem Index 'index'.
		     */
		    public static int digitAt(int number, int index) {
		        return String.valueOf(number).charAt(index) - '0';
		    


	}

}

JPlag viewer:
image001

Note the wrong characters in line 28. The .java file is of UTF-8 encoding. When opening it in a text editor (with UTF-8 being correctly recognized as the encoding), things look normal.

@Kr0nox
Copy link
Member

Kr0nox commented Dec 19, 2024

@muety Could you attach the file to the issue, so we can reproduce it easier and find the error
And please add what version you used

@tsaglam
Copy link
Member

tsaglam commented Dec 21, 2024

This might be a conversion issue. If the student's file is not UTF-8, we try to guess the file encoding and convert it to UTF-8 in order to prevent issues where the Java compiler cannot parse the file. However, there is inherently no way to always correctly determine the file encoding if it is unknown. Thus, sometimes it is incorrectly guessed. Note: this issue can also arise if you convert the files yourself before submitting them to JPlag. Some learning platforms, such as Artemis, might also do this.

@muety
Copy link
Author

muety commented Dec 21, 2024

I can't share the file, unfortunately, because I'd first have to trim sensitive information, which would potentially also modify encoding, etc.

When downloading the file from ILIAS learning platform, it has UTF-8 encoding and everything looks fine regardless of which editor I open it in. Only JPlag will show those weird characters.

Same for many other students (mostly using Eclipse on Windows).

@Kr0nox
Copy link
Member

Kr0nox commented Dec 21, 2024

This is fixed in #2118

Copy link

Closed by #2118.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants