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

Double click to open file chokes on special characters and spaces

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10, Java build 14+36-1461

      A DESCRIPTION OF THE PROBLEM :
      When creating an installer package, jpackage uses the --file-associations command to associate filetypes with the application on install. I have noticed two problems in Windows with this.

      1) If there are special characters such as "é" in the path to the file, the string passed into the application as an argument will be corrupted.

      2) If there are spaces in the path to the file, the path will be split on these spaces, and passed in as multiple entries in the args handed in.

      REGRESSION : Last worked in version 14

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Create a basic Java 14 application which accepts arguments to its main function and outputs them somehow.
      2) Build the project and use jpackage to create an installer while using the --file-associations command to associate a file type with the application.
      3) Install the application.
      4) Create a file of the associated type which has a special character (such as "é") in either the name or the general path (including folder names).
      5) Double click the file.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The path passed in should have a string which is encoded properly and which contains the "é" as a single character.
      ACTUAL -
      The path passed in to the application will have corrupted characters instead of the "é".

      ---------- BEGIN SOURCE ----------
      All you need is a main method that accepts arguments.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I have not found one. I tried taking the passed string and passing it back and forth into byte arrays using different character encodings, but did not have success.

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                asemenyuk Alexey Semenyuk
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: