Class SpecificCharacterSet

java.lang.Object
org.aoju.bus.image.galaxy.data.SpecificCharacterSet

public class SpecificCharacterSet extends Object
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

    • ASCII

      public static final SpecificCharacterSet ASCII
    • codecs

      protected final org.aoju.bus.image.galaxy.data.SpecificCharacterSet.Codec[] codecs
    • dicomCodes

      protected final String[] dicomCodes
  • Constructor Details

    • SpecificCharacterSet

      protected SpecificCharacterSet(org.aoju.bus.image.galaxy.data.SpecificCharacterSet.Codec[] codecs, String... codes)
  • Method Details

    • getDefaultCharacterSet

      public static SpecificCharacterSet getDefaultCharacterSet()
    • setDefaultCharacterSet

      public static void setDefaultCharacterSet(String code)
    • setCharsetNameMapping

      public static void setCharsetNameMapping(String code, String charsetName)
      Overwrites mapping of value of DICOM Specific Character Set (0008,0005) to named charset.

      For example, SpecificCharacterSet.setCharsetNameMapping("ISO_IR 100", "ISO-8859-15") associates ISO-8859-15 (Latin-9), SpecificCharacterSet.setCharsetNameMapping("ISO_IR 100", "windows-1252") Windows-1252 (CP-1252), with DICOM Specific Character Set (0008,0005) code value ISO_IR 100 - replacing the default mapping to ISO-8859-1 (Latin-1) - were both (ISO-8859-15 and Windows-1252) containing characters Š/š and Ž/ž not included in Latin-1, but used in Estonian and Finnish for transcribing foreign names.

      Parameters:
      code - value of DICOM Specific Character Set (0008,0005)
      charsetName - The name of the mapped charset
      Throws:
      IllegalCharsetNameException - If the given code or charset name is illegal
      IllegalArgumentException - If the given charsetName is null
      UnsupportedCharsetException - If no support for the named charset is available in this instance of the Java virtual machine
    • resetCharsetNameMappings

      public static void resetCharsetNameMappings()
      Reset mapping of DICOM Specific Character Set (0008,0005) values to named charsets as specified by DICOM PS 3.3 Table C.12-2.
    • checkSpecificCharacterSet

      public static String checkSpecificCharacterSet(String code)
    • checkCharsetName

      public static String checkCharsetName(String charsetName)
    • valueOf

      public static SpecificCharacterSet valueOf(String... codes)
    • trimISO2022

      public static boolean trimISO2022(String[] codes)
      Replace single code for Single-Byte Character Sets with Code Extensions by code for Single-Byte Character Sets without Code Extensions.
      Parameters:
      codes - the codes
      Returns:
      true if the code was replaced.
    • toCodes

      public String[] toCodes()
    • encode

      public byte[] encode(String val, String delimiters)
    • decode

      public String decode(byte[] val)
    • isUTF8

      public boolean isUTF8()
    • isASCII

      public boolean isASCII()
    • containsASCII

      public boolean containsASCII()
    • contains

      public boolean contains(SpecificCharacterSet other)
    • toText

      public String toText(String s)
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object