Skip to content

Commit

Permalink
Ensure text is rendered as UTF-8
Browse files Browse the repository at this point in the history
Java <= 8 used ISO-8859-1.
  • Loading branch information
Abbe98 committed Feb 4, 2022
1 parent e5a7a00 commit bfa752a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/pattypan/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
Expand Down Expand Up @@ -63,12 +62,9 @@ private Util() {}

public static String text(String key) {
try {
String val = bundle.getString(key);
return new String(val.getBytes("ISO-8859-1"), "UTF-8");
return bundle.getString(key);
} catch (final MissingResourceException ex) {
return "";
} catch (UnsupportedEncodingException ex) {
return "";
}
}

Expand Down

0 comments on commit bfa752a

Please sign in to comment.