From 5a115ccdd1e95c02a5b76b0c9d73b12ec7589eb3 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Thu, 24 Sep 2020 17:49:56 -0400 Subject: [PATCH] prevent "illegal line" message when loading library with FEFF chars in properties file --- app/src/processing/app/Util.java | 6 +++--- core/todo.txt | 1 + todo.txt | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/Util.java b/app/src/processing/app/Util.java index fefc3b8b7..951474561 100644 --- a/app/src/processing/app/Util.java +++ b/app/src/processing/app/Util.java @@ -103,14 +103,14 @@ public class Util { if (commentMarker != -1) { line = line.substring(0, commentMarker); } - // Remove extra whitespace - line = line.trim(); + // Remove extra whitespace (including the x00A0 and xFEFF) + line = PApplet.trim(line); if (line.length() != 0) { int equals = line.indexOf('='); if (equals == -1) { if (filename != null) { - System.err.println("Ignoring illegal line in " + filename); + System.err.println("Ignoring illegal line in " + filename + ":"); System.err.println(" " + line); } } else { diff --git a/core/todo.txt b/core/todo.txt index ee0693656..b954f1953 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -2,6 +2,7 @@ X loadJSONObject/Array() now return null if the given file was not found X https://github.com/processing/processing/pull/6081 X remove zero width no-break space (U+FEFF) character with trim() +X fix "illegal line" message when loading library with FEFF chars in properties file fixed in 4.x (close/lock these with final 4.0 release) diff --git a/todo.txt b/todo.txt index 73b871c10..3dc6c9f4e 100755 --- a/todo.txt +++ b/todo.txt @@ -6,6 +6,7 @@ X also for exported applications X audio and video broken on macOS b/c can't access mic/camera X https://github.com/processing/processing-sound/issues/51 X 'ant source-jar' target added to core +X https://github.com/processing/processing4/issues/118 contribs