Tabnine Logo
NativeConverter.getAvailableCharsetNames
Code IndexAdd Tabnine to your IDE (free)

How to use
getAvailableCharsetNames
method
in
libcore.icu.NativeConverter

Best Java code snippets using libcore.icu.NativeConverter.getAvailableCharsetNames (Showing top 7 results out of 315)

origin: robovm/robovm

/**
 * Returns an immutable case-insensitive map from canonical names to {@code Charset} instances.
 * If multiple charsets have the same canonical name, it is unspecified which is returned in
 * the map. This method may be slow. If you know which charset you're looking for, use
 * {@link #forName}.
 */
public static SortedMap<String, Charset> availableCharsets() {
  // Start with a copy of the built-in charsets...
  TreeMap<String, Charset> charsets = new TreeMap<String, Charset>(String.CASE_INSENSITIVE_ORDER);
  for (String charsetName : NativeConverter.getAvailableCharsetNames()) {
    // RoboVM note: Added try-catch to ignore charsets with bad names (e.g. "x-UTF-16,version=1")
    try {
      Charset charset = NativeConverter.charsetForName(charsetName);
      charsets.put(charset.name(), charset);
    } catch (IllegalCharsetNameException e) {
    }
  }
  // Add all charsets provided by all charset providers...
  for (CharsetProvider charsetProvider : ServiceLoader.load(CharsetProvider.class)) {
    Iterator<Charset> it = charsetProvider.charsets();
    while (it.hasNext()) {
      Charset cs = it.next();
      // A CharsetProvider can't override a built-in Charset.
      if (!charsets.containsKey(cs.name())) {
        charsets.put(cs.name(), cs);
      }
    }
  }
  return Collections.unmodifiableSortedMap(charsets);
}
origin: ibinti/bugvm

/**
 * Returns an immutable case-insensitive map from canonical names to {@code Charset} instances.
 * If multiple charsets have the same canonical name, it is unspecified which is returned in
 * the map. This method may be slow. If you know which charset you're looking for, use
 * {@link #forName}.
 */
public static SortedMap<String, Charset> availableCharsets() {
  // Start with a copy of the built-in charsets...
  TreeMap<String, Charset> charsets = new TreeMap<String, Charset>(String.CASE_INSENSITIVE_ORDER);
  for (String charsetName : NativeConverter.getAvailableCharsetNames()) {
    // BugVM note: Added try-catch to ignore charsets with bad names (e.g. "x-UTF-16,version=1")
    try {
      Charset charset = NativeConverter.charsetForName(charsetName);
      charsets.put(charset.name(), charset);
    } catch (IllegalCharsetNameException e) {
    }
  }
  // Add all charsets provided by all charset providers...
  for (CharsetProvider charsetProvider : ServiceLoader.load(CharsetProvider.class)) {
    Iterator<Charset> it = charsetProvider.charsets();
    while (it.hasNext()) {
      Charset cs = it.next();
      // A CharsetProvider can't override a built-in Charset.
      if (!charsets.containsKey(cs.name())) {
        charsets.put(cs.name(), cs);
      }
    }
  }
  return Collections.unmodifiableSortedMap(charsets);
}
origin: MobiVM/robovm

/**
 * Returns an immutable case-insensitive map from canonical names to {@code Charset} instances.
 * If multiple charsets have the same canonical name, it is unspecified which is returned in
 * the map. This method may be slow. If you know which charset you're looking for, use
 * {@link #forName}.
 */
public static SortedMap<String, Charset> availableCharsets() {
  // Start with a copy of the built-in charsets...
  TreeMap<String, Charset> charsets = new TreeMap<String, Charset>(String.CASE_INSENSITIVE_ORDER);
  for (String charsetName : NativeConverter.getAvailableCharsetNames()) {
    // RoboVM note: Added try-catch to ignore charsets with bad names (e.g. "x-UTF-16,version=1")
    try {
      Charset charset = NativeConverter.charsetForName(charsetName);
      charsets.put(charset.name(), charset);
    } catch (IllegalCharsetNameException e) {
    }
  }
  // Add all charsets provided by all charset providers...
  for (CharsetProvider charsetProvider : ServiceLoader.load(CharsetProvider.class)) {
    Iterator<Charset> it = charsetProvider.charsets();
    while (it.hasNext()) {
      Charset cs = it.next();
      // A CharsetProvider can't override a built-in Charset.
      if (!charsets.containsKey(cs.name())) {
        charsets.put(cs.name(), cs);
      }
    }
  }
  return Collections.unmodifiableSortedMap(charsets);
}
origin: com.bugvm/bugvm-rt

/**
 * Returns an immutable case-insensitive map from canonical names to {@code Charset} instances.
 * If multiple charsets have the same canonical name, it is unspecified which is returned in
 * the map. This method may be slow. If you know which charset you're looking for, use
 * {@link #forName}.
 */
public static SortedMap<String, Charset> availableCharsets() {
  // Start with a copy of the built-in charsets...
  TreeMap<String, Charset> charsets = new TreeMap<String, Charset>(String.CASE_INSENSITIVE_ORDER);
  for (String charsetName : NativeConverter.getAvailableCharsetNames()) {
    // BugVM note: Added try-catch to ignore charsets with bad names (e.g. "x-UTF-16,version=1")
    try {
      Charset charset = NativeConverter.charsetForName(charsetName);
      charsets.put(charset.name(), charset);
    } catch (IllegalCharsetNameException e) {
    }
  }
  // Add all charsets provided by all charset providers...
  for (CharsetProvider charsetProvider : ServiceLoader.load(CharsetProvider.class)) {
    Iterator<Charset> it = charsetProvider.charsets();
    while (it.hasNext()) {
      Charset cs = it.next();
      // A CharsetProvider can't override a built-in Charset.
      if (!charsets.containsKey(cs.name())) {
        charsets.put(cs.name(), cs);
      }
    }
  }
  return Collections.unmodifiableSortedMap(charsets);
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns an immutable case-insensitive map from canonical names to {@code Charset} instances.
 * If multiple charsets have the same canonical name, it is unspecified which is returned in
 * the map. This method may be slow. If you know which charset you're looking for, use
 * {@link #forName}.
 */
public static SortedMap<String, Charset> availableCharsets() {
  // Start with a copy of the built-in charsets...
  TreeMap<String, Charset> charsets = new TreeMap<String, Charset>(String.CASE_INSENSITIVE_ORDER);
  for (String charsetName : NativeConverter.getAvailableCharsetNames()) {
    // RoboVM note: Added try-catch to ignore charsets with bad names (e.g. "x-UTF-16,version=1")
    try {
      Charset charset = NativeConverter.charsetForName(charsetName);
      charsets.put(charset.name(), charset);
    } catch (IllegalCharsetNameException e) {
    }
  }
  // Add all charsets provided by all charset providers...
  for (CharsetProvider charsetProvider : ServiceLoader.load(CharsetProvider.class)) {
    Iterator<Charset> it = charsetProvider.charsets();
    while (it.hasNext()) {
      Charset cs = it.next();
      // A CharsetProvider can't override a built-in Charset.
      if (!charsets.containsKey(cs.name())) {
        charsets.put(cs.name(), cs);
      }
    }
  }
  return Collections.unmodifiableSortedMap(charsets);
}
origin: com.gluonhq/robovm-rt

/**
 * Returns an immutable case-insensitive map from canonical names to {@code Charset} instances.
 * If multiple charsets have the same canonical name, it is unspecified which is returned in
 * the map. This method may be slow. If you know which charset you're looking for, use
 * {@link #forName}.
 */
public static SortedMap<String, Charset> availableCharsets() {
  // Start with a copy of the built-in charsets...
  TreeMap<String, Charset> charsets = new TreeMap<String, Charset>(String.CASE_INSENSITIVE_ORDER);
  for (String charsetName : NativeConverter.getAvailableCharsetNames()) {
    // RoboVM note: Added try-catch to ignore charsets with bad names (e.g. "x-UTF-16,version=1")
    try {
      Charset charset = NativeConverter.charsetForName(charsetName);
      charsets.put(charset.name(), charset);
    } catch (IllegalCharsetNameException e) {
    }
  }
  // Add all charsets provided by all charset providers...
  for (CharsetProvider charsetProvider : ServiceLoader.load(CharsetProvider.class)) {
    Iterator<Charset> it = charsetProvider.charsets();
    while (it.hasNext()) {
      Charset cs = it.next();
      // A CharsetProvider can't override a built-in Charset.
      if (!charsets.containsKey(cs.name())) {
        charsets.put(cs.name(), cs);
      }
    }
  }
  return Collections.unmodifiableSortedMap(charsets);
}
origin: FlexoVM/flexovm

/**
 * Returns an immutable case-insensitive map from canonical names to {@code Charset} instances.
 * If multiple charsets have the same canonical name, it is unspecified which is returned in
 * the map. This method may be slow. If you know which charset you're looking for, use
 * {@link #forName}.
 */
public static SortedMap<String, Charset> availableCharsets() {
  // Start with a copy of the built-in charsets...
  TreeMap<String, Charset> charsets = new TreeMap<String, Charset>(String.CASE_INSENSITIVE_ORDER);
  for (String charsetName : NativeConverter.getAvailableCharsetNames()) {
    // RoboVM note: Added try-catch to ignore charsets with bad names (e.g. "x-UTF-16,version=1")
    try {
      Charset charset = NativeConverter.charsetForName(charsetName);
      charsets.put(charset.name(), charset);
    } catch (IllegalCharsetNameException e) {
    }
  }
  // Add all charsets provided by all charset providers...
  for (CharsetProvider charsetProvider : ServiceLoader.load(CharsetProvider.class)) {
    Iterator<Charset> it = charsetProvider.charsets();
    while (it.hasNext()) {
      Charset cs = it.next();
      // A CharsetProvider can't override a built-in Charset.
      if (!charsets.containsKey(cs.name())) {
        charsets.put(cs.name(), cs);
      }
    }
  }
  return Collections.unmodifiableSortedMap(charsets);
}
libcore.icuNativeConvertergetAvailableCharsetNames

Popular methods of NativeConverter

  • charsetForName
  • closeConverter
  • contains
  • decode
  • encode
  • getAveBytesPerChar
  • getAveCharsPerByte
  • getMaxBytesPerChar
  • getSubstitutionBytes
  • openConverter
  • resetByteToChar
  • resetCharToByte
  • resetByteToChar,
  • resetCharToByte,
  • setCallbackDecode,
  • setCallbackEncode,
  • translateCodingErrorAction

Popular in Java

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JFileChooser (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now