Skip to content

Commit

Permalink
TMP: Test for non-Latin-1 paths
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed May 18, 2023
1 parent 0511bb4 commit 6b52236
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public static PathFragment create(String path) {
if (path.isEmpty()) {
return EMPTY_FRAGMENT;
}
if (path.chars().anyMatch(c -> c > 0xff)) {
throw new IllegalArgumentException("Non-Latin-1 path: " + path);
}
int normalizationLevel = OS.needsToNormalize(path);
String normalizedPath =
normalizationLevel != OsPathPolicy.NORMALIZED
Expand Down

0 comments on commit 6b52236

Please sign in to comment.