Package java.nio.charset

Examples of java.nio.charset.Charset.displayName()


        Charset c = Charset.isSupported("UTF-8") ? Charset.forName("UTF-8") : Charset.defaultCharset();
        if (charset != null) {
            if (Charset.isSupported(charset)) {
                c = Charset.forName(charset);
            } else {
                LOGGER.error("Charset " + charset + " is not supported for layout, using " + c.displayName());
            }
        }
        Layout layout = (RFC5424.equalsIgnoreCase(format)) ?
            RFC5424Layout.createLayout(facility, id, ein, includeMDC, mdcId, includeNL, appName,  msgId,
                excludes, includes, required, charset, config) :
View Full Code Here


        Charset c = Charset.isSupported("UTF-8") ? Charset.forName("UTF-8") : Charset.defaultCharset();
        if (charset != null) {
            if (Charset.isSupported(charset)) {
                c = Charset.forName(charset);
            } else {
                LOGGER.error("Charset " + charset + " is not supported for layout, using " + c.displayName());
            }
        }
        return new PatternLayout(config, replace, pattern == null ? DEFAULT_CONVERSION_PATTERN : pattern, c);
    }
}
View Full Code Here

        Charset c = Charset.isSupported("UTF-8") ? Charset.forName("UTF-8") : Charset.defaultCharset();
        if (charset != null) {
            if (Charset.isSupported(charset)) {
                c = Charset.forName(charset);
            } else {
                LOGGER.error("Charset " + charset + " is not supported for layout, using " + c.displayName());
            }
        }
        if (includes != null && excludes != null) {
            LOGGER.error("mdcIncludes and mdcExcludes are mutually exclusive. Includes wil be ignored");
            includes = null;
View Full Code Here

    statusCode = httpResponse.getStatusLine().getStatusCode();
    statusText = httpResponse.getStatusLine().getReasonPhrase();
    response = EntityUtils.toString(httpResponse.getEntity());
    contentType = ContentType.getOrDefault(httpResponse.getEntity()).getMimeType();
    Charset charset = ContentType.getOrDefault(httpResponse.getEntity()).getCharset();
    characterEncoding = (charset == null) ? "" : charset.displayName();
    EntityUtils.consume(httpResponse.getEntity());
    httpClient.getConnectionManager().shutdown();
    httpClient.close();
    return this;
  }
View Full Code Here

     */
    private String getDefaultCharsetName()
    {
        final String charSetName = System.getProperty("file.encoding");
        final Charset charSet = Charset.forName(charSetName);
        return charSet.displayName();
    }



    /**
 
View Full Code Here

     */
    private String getDefaultCharsetName()
    {
        final String charSetName = System.getProperty("file.encoding");
        final Charset charSet = Charset.forName(charSetName);
        return charSet.displayName();
    }



    /**
 
View Full Code Here

        List charsetList = new ArrayList();
        Map map = Charset.availableCharsets();
        for (Iterator it = map.values().iterator(); it.hasNext();) {
            Charset charset = (Charset) it.next();
            charsetList.add(charset.displayName().toLowerCase());
        }
        charsetList.add(0, "<Autodetect>");
        inputEncodingCombo = new JComboBox(charsetList.toArray());
        charsetList.remove(0);
        charsetList.add(0, "<Default>");
View Full Code Here

    List charsetList = new ArrayList();
    Map map = Charset.availableCharsets();
    for (Iterator it = map.values().iterator(); it.hasNext();) {
      Charset charset = (Charset) it.next();
      charsetList.add(charset.displayName());
    }

    JList list = new JList(charsetList.toArray());
    panelBuilder = new PanelBuilder(new FormLayout("fill:pref:grow", "fill:pref:grow"));
    panelBuilder.setBorder(Borders.TABBED_DIALOG_BORDER);
View Full Code Here

      contentEncoding = encoding.getValue();
    }

    Charset charset = ContentType.getOrDefault(entity).getCharset();
    if (charset != null) {
      contentCharset = charset.displayName()
    }

    contentData = EntityUtils.toByteArray(entity);
  }
 
View Full Code Here

        Charset c = Charset.isSupported("UTF-8") ? Charset.forName("UTF-8") : Charset.defaultCharset();
        if (charset != null) {
            if (Charset.isSupported(charset)) {
                c = Charset.forName(charset);
            } else {
                LOGGER.error("Charset " + charset + " is not supported for layout, using " + c.displayName());
            }
        }
        return new PatternLayout(config, replace, pattern == null ? DEFAULT_CONVERSION_PATTERN : pattern, c);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.