Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8354659

PathMatcher doesn't match path with specific unicode symbol

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      macOS Monterey

      A DESCRIPTION OF THE PROBLEM :
      It seems Java's glob path matcher isn't matching some unicode symbols.

      Note that this does return true on Windows and Linux

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

      ---------- BEGIN SOURCE ----------
      $ jshell
      | Welcome to JShell -- Version 24
      | For an introduction type: /help intro

      jshell> var matcher = java.nio.file.FileSystems.getDefault().getPathMatcher("glob:*.*")
         ...>
      matcher ==> sun.nio.fs.UnixFileSystem$1@2328c243

      jshell> matcher.matches(new java.io.File("Article.md").toPath())
         ...>
      $2 ==> true

      jshell> matcher.matches(new java.io.File("🗞️ Article.md").toPath())
         ...>
      $3 ==> false
      ---------- END SOURCE ----------

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      matcher.matches(new java.io.File("🗞️ Article.md").toPath()) returns true

      ACTUAL -
      matcher.matches(new java.io.File("🗞️ Article.md").toPath()) returns false


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: