Skip to content

Commit

Permalink
Fixes java-decompiler#61, "Invalid unicode" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Aug 12, 2015
1 parent 12c9c35 commit 3fe11bf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ public void saveContent(API api, Controller controller, Listener listener, Path
// Metadata
if (getPreferenceValue(p, WRITE_METADATA, true)) {
// Add location
String location =
new File(entry.getUri()).getPath()
// Escape "\ u" sequence to prevent "Invalid unicode" errors
.replaceAll("(^|[^\\\\])\\\\u", "\\\\\\\\u");
ps.print("\n\n/* Location: ");
ps.print(new File(entry.getUri()).getPath());
ps.print(location);
// Add Java compiler version
int majorVersion = printer.getMajorVersion();

Expand Down

0 comments on commit 3fe11bf

Please sign in to comment.