Java String Decode by Charset reportingDecoder(Charset cset)

Here you can find the source of reportingDecoder(Charset cset)

Description

reporting Decoder

License

Open Source License

Declaration

private static CharsetDecoder reportingDecoder(Charset cset) 

Method Source Code

//package com.java2s;
/*/* ww w  .ja va  2s .c o m*/
 * ***** BEGIN LICENSE BLOCK *****
 * Zimbra Collaboration Suite Server
 * Copyright (C) 2016 Synacor, Inc.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software Foundation,
 * version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with this program.
 * If not, see <https://www.gnu.org/licenses/>.
 * ***** END LICENSE BLOCK *****
 */

import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CodingErrorAction;

public class Main {
    private static CharsetDecoder reportingDecoder(Charset cset) {
        return cset.newDecoder().onMalformedInput(CodingErrorAction.REPORT)
                .onUnmappableCharacter(CodingErrorAction.REPORT);
    }
}

Related

  1. getCharsetDecoder(String charsetName)
  2. getDecoder(Charset charset)
  3. getDecoder(Charset charset)
  4. getDecoder(String charset)
  5. pooledCharBuffer(int len, CharsetDecoder decoder)
  6. stringDecoder(String string, Charset charset)
  7. unicodeCodePoint2PercentHexString(int codePoint, String charsetName)
  8. urlDecode(final String str, final Charset encoding)