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

java single-source programs: either use UTF-8, or allow to specify encoding

    Details

    • Type: Enhancement
    • Status: New
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 14
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      A DESCRIPTION OF THE PROBLEM :
      When running single-source programs, java uses the system's default encoding & there's no way to specify the encoding (as is the case with javac and its "-encoding" parameter). I believe this is problematic for several reasons:
      - single-source programs cannot use any encoding other than the system's default, e.g. UTF-8
      - as a consequence of the first, they are not portable across systems (or might start behaving differently when the system's default encoding is changed)
      - UTF-8 is the de facto standard encoding, and there's a JEP draft to move away from relying on the system's default encoding ( http://openjdk.java.net/jeps/8187041 )

      So my propopsal is to:
      - support the "-encoding" parameter for single-source programs
      - both for javac and java, to specify that UTF-8 is the default encoding



        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: