本文整理汇总了Java中com.ximpleware.VTDNav.FORMAT_UTF8属性的典型用法代码示例。如果您正苦于以下问题:Java VTDNav.FORMAT_UTF8属性的具体用法?Java VTDNav.FORMAT_UTF8怎么用?Java VTDNav.FORMAT_UTF8使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.ximpleware.VTDNav
的用法示例。
在下文中一共展示了VTDNav.FORMAT_UTF8属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLen
/**
*
* @param ch
* @param output_encoding
* @return
* @throws TranscodeException
*
*/
public static final int getLen(int ch, int output_encoding)
throws TranscodeException {
switch (output_encoding) {
case VTDNav.FORMAT_ASCII:
return ASCII_Coder.getLen(ch);
case VTDNav.FORMAT_UTF8:
return UTF8_Coder.getLen(ch);
case VTDNav.FORMAT_ISO_8859_1:
return ISO8859_1Coder.getLen(ch);
case VTDNav.FORMAT_UTF_16LE:
return UTF16LE_Coder.getLen(ch);
case VTDNav.FORMAT_UTF_16BE:
return UTF16BE_Coder.getLen(ch);
default:
throw new com.ximpleware.TranscodeException("Unsupported encoding");
}
}
示例2: decode
/**
*
* @param input
* @param offset
* @param input_encoding
* @return
* @throws TranscodeException
*
*/
public static final long decode(byte[] input, int offset, int input_encoding)
throws TranscodeException {
switch (input_encoding) {
case VTDNav.FORMAT_ASCII:
return ASCII_Coder.decode(input, offset);
case VTDNav.FORMAT_UTF8:
return UTF8_Coder.decode(input, offset);
case VTDNav.FORMAT_ISO_8859_1:
return ISO8859_1Coder.decode(input, offset);
case VTDNav.FORMAT_UTF_16LE:
return UTF16LE_Coder.decode(input, offset);
case VTDNav.FORMAT_UTF_16BE:
return UTF16BE_Coder.decode(input, offset);
default:
throw new com.ximpleware.TranscodeException("Unsupported encoding");
}
}
示例3: encode
/**
*
* @param output
* @param offset
* @param ch
* @param output_encoding
* @return
* @throws TranscodeException
*
*/
public static final int encode(byte[] output, int offset, int ch,
int output_encoding) throws TranscodeException {
switch (output_encoding) {
case VTDNav.FORMAT_ASCII:
return ASCII_Coder.encode(output, offset, ch);
case VTDNav.FORMAT_UTF8:
return UTF8_Coder.encode(output, offset, ch);
case VTDNav.FORMAT_ISO_8859_1:
return ISO8859_1Coder.encode(output, offset, ch);
case VTDNav.FORMAT_UTF_16LE:
return UTF16LE_Coder.encode(output, offset, ch);
case VTDNav.FORMAT_UTF_16BE:
return UTF16BE_Coder.encode(output, offset, ch);
default:
throw new com.ximpleware.TranscodeException("Unsupported encoding");
}
}
示例4: encodeAndWrite
public static final void encodeAndWrite(OutputStream os, int ch,
int output_encoding) throws TranscodeException, IOException {
switch (output_encoding) {
case VTDNav.FORMAT_ASCII:
ASCII_Coder.encodeAndWrite(os, ch);
return;
case VTDNav.FORMAT_UTF8:
UTF8_Coder.encodeAndWrite(os, ch);
return;
case VTDNav.FORMAT_ISO_8859_1:
ISO8859_1Coder.encodeAndWrite(os, ch);
return;
case VTDNav.FORMAT_UTF_16LE:
UTF16LE_Coder.encodeAndWrite(os, ch);
return;
case VTDNav.FORMAT_UTF_16BE:
UTF16BE_Coder.encodeAndWrite(os, ch);
return;
default:
throw new com.ximpleware.TranscodeException("Unsupported encoding");
}
}
示例5: getCharsetByEncoding
/**
* 根据 vn 的 encoding 获取字符集编码(此方法与 XMLModifier 的 bind 方法中获取字符集的方式一致)
* @return
* @throws ModifyException
* ;
*/
public String getCharsetByEncoding() throws ModifyException {
int encoding = vn.getEncoding();
switch (encoding) {
case VTDNav.FORMAT_ASCII:
return "ASCII";
case VTDNav.FORMAT_ISO_8859_1:
return "ISO8859_1";
case VTDNav.FORMAT_UTF8:
return "UTF8";
case VTDNav.FORMAT_UTF_16BE:
return "UnicodeBigUnmarked";
case VTDNav.FORMAT_UTF_16LE:
return "UnicodeLittleUnmarked";
case VTDNav.FORMAT_ISO_8859_2:
return "ISO8859_2";
case VTDNav.FORMAT_ISO_8859_3:
return "ISO8859_3";
case VTDNav.FORMAT_ISO_8859_4:
return "ISO8859_4";
case VTDNav.FORMAT_ISO_8859_5:
return "ISO8859_5";
case VTDNav.FORMAT_ISO_8859_6:
return "ISO8859_6";
case VTDNav.FORMAT_ISO_8859_7:
return "ISO8859_7";
case VTDNav.FORMAT_ISO_8859_8:
return "ISO8859_8";
case VTDNav.FORMAT_ISO_8859_9:
return "ISO8859_9";
case VTDNav.FORMAT_ISO_8859_10:
return "ISO8859_10";
case VTDNav.FORMAT_ISO_8859_11:
return "x-iso-8859-11";
case VTDNav.FORMAT_ISO_8859_12:
return "ISO8859_12";
case VTDNav.FORMAT_ISO_8859_13:
return "ISO8859_13";
case VTDNav.FORMAT_ISO_8859_14:
return "ISO8859_14";
case VTDNav.FORMAT_ISO_8859_15:
return "ISO8859_15";
case VTDNav.FORMAT_WIN_1250:
return "Cp1250";
case VTDNav.FORMAT_WIN_1251:
return "Cp1251";
case VTDNav.FORMAT_WIN_1252:
return "Cp1252";
case VTDNav.FORMAT_WIN_1253:
return "Cp1253";
case VTDNav.FORMAT_WIN_1254:
return "Cp1254";
case VTDNav.FORMAT_WIN_1255:
return "Cp1255";
case VTDNav.FORMAT_WIN_1256:
return "Cp1256";
case VTDNav.FORMAT_WIN_1257:
return "Cp1257";
case VTDNav.FORMAT_WIN_1258:
return "Cp1258";
default:
throw new ModifyException(Messages.getString("vtdimpl.VTDUtils.logger2"));
}
}