public class CharsetEncodingUtils extends Object
public static byte encodeAsUTF8(String input) throws IOException
String.getBytes(java.nio.charset.Charset)(with "UTF-8"), except that encoding problems (like unpaired surrogates) are reported as exceptions (see
CodingErrorAction.REPORT, instead of being silently replaces as it would happen otherwise.
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.