Package java.nio.charset

Examples of java.nio.charset.UnsupportedCharsetException


        }

        try {
            return URLDecoder.decode(s, charset);
        } catch (UnsupportedEncodingException e) {
            throw new UnsupportedCharsetException(charset);
        }
    }
View Full Code Here


    decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
    decoder.reset();
    encoding = EncodingHelper.getOldCanonical(charset.name()); */
    String encoding = charset.name();
    if (!setEncType(encoding))
      throw new UnsupportedCharsetException(encoding);
  }
View Full Code Here

      encoding = "US-ASCII";
    else
      encoding = EncodingHelper.getOldCanonical(decoder.charset().name()); */
    String encoding = decoder.charset().name();
    if (!setEncType(encoding))
      throw new UnsupportedCharsetException(encoding);
  }
View Full Code Here

    encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
    outputBuffer = CharBuffer.allocate(BUFFER_SIZE);
    encodingName = EncodingHelper.getOldCanonical(cs.name()); */
    String encoding = cs.name();
    if (!setEncType(encoding))
      throw new UnsupportedCharsetException(encoding);
  }
View Full Code Here

      encodingName = "US-ASCII";
    else
      encodingName = EncodingHelper.getOldCanonical(cs.name()); */
    String encoding = enc.charset().name();
    if (!setEncType(encoding))
      throw new UnsupportedCharsetException(encoding);
  }
View Full Code Here

    private static String encodeComponent(String s, Charset charset) {
        try {
            return URLEncoder.encode(s, charset.name()).replaceAll("\\+", "%20");
        } catch (UnsupportedEncodingException e) {
            throw new UnsupportedCharsetException(charset.name());
        }
    }
View Full Code Here

    if (charsetName == null) {
      throw new NullPointerException();
    }
   
    if (!Charset.isSupported(charsetName)) {
      throw new UnsupportedCharsetException("The charset " + charsetName + " is not supported.");
    }
   
    this.charsetName = charsetName;
  }
View Full Code Here

    }

    /** 判断charset是否被支持。 */
    public LocaleInfo assertCharsetSupported() throws UnsupportedCharsetException {
        if (charset instanceof UnknownCharset) {
            throw new UnsupportedCharsetException(charset.name());
        }

        return this;
    }
View Full Code Here

        {
            return URLEncoder.encode(value, charset.name());
        }
        catch (UnsupportedEncodingException x)
        {
            throw new UnsupportedCharsetException(charset.name());
        }
    }
View Full Code Here

            {
                return new String(getContent(), encoding);
            }
            catch (UnsupportedEncodingException e)
            {
                throw new UnsupportedCharsetException(encoding);
            }
        }
    }
View Full Code Here

TOP

Related Classes of java.nio.charset.UnsupportedCharsetException

Copyright © 2018 www.massapicom. 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.