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

jpackage: allow to specify codepage on Windows

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P4 P4
    • 21
    • tools
    • None
    • behavioral
    • low
    • Adding new CLI option to jpackage
    • add/remove/modify command line option
    • JDK

      Summary

      Allow user to specify a Codepage attribute value (to not be confused with file encoding) for WiX input files generated by jpackage.

      Problem

      Encoding ID, specified in a Codepage value, is used by WiX when it prepares input data for Windows Installer. Components (for example, files) names can only use characters from the character set allowed by the specified encoding. In jpackage scenario the encoding ID is determined by the Codepage attribute in a localization file. When JVM runs in en-US locale and no custom localization files are used, then windows-1252 encoding is used. This encoding doesn't allow to use (in filenames) non-ASCII characters, that can be represented in windows-125x encoding, but not in windows-1252 (for example, windows-1251 Bulgarian Cyrillic).

      Solution

      It is proposed to allow user to specify required encoding ID in a CLI argument. To pass this value to WiX it is necessary to replace the Codepage attribute value in a jpackage primary localization file, when it is being copied to the config directory. Note, it is not possible to use WiX variables, like $(var.MyCodepage), in localization files.

      Alternative solution (that works with existing jpackage implementation) is to require user to prepare a custom localization file and specify path it it using "--resource-dir" argument. Effective encoding ID will be determined by the Codepage attribute from the custom file in this case. This solution has a shortcoming, that custom localization file cannot have the same Culture attribute value as the primary file. Thus the default "en-US" localization for installer GUI forms cannot be used with this solution.

      Specification

      Add the following CLI option:

      --win-codepage <codepage name or ID>
      
      codepage value for Windows Installer database

            asemenyuk Alexey Semenyuk
            akasko Alex Kasko
            Alexander Matveev, Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: