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

Provide names of supported charsets

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • 7
    • core-libs

      A DESCRIPTION OF THE REQUEST :
      Charset.availableCharsets() returns completely initialized charset, which is an expensive operation.

      I propose to additionally provide a set/list which only contains the names of the supported charsets.

      JUSTIFICATION :
      Charset.availableCharsets() is an performance and memory expensive operation.

      In many cases just providing the names should suffice.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      provides a list/set of names, optionally including all aliases, of supported charsets.

      ---------- BEGIN SOURCE ----------
      public class Charset {
          /**
           * Returns a list of the names of currently available charsets
           * with or without valid aliases in case insensitive order.
           */
          public static List<String> supportedCharsets(boolean withAliases);
          /**
           * Returns a list of arrays containing the aliases of currently available charsets
           * in same order than canonical names without aliases from supportedCharsets.
           */
          public static List<String[]> supportedAliases();
          ...
      }

      ---------- END SOURCE ----------

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: