当前位置: 首页>>代码示例>>Java>>正文


Java UnsupportedEncodingException.getMessage方法代码示例

本文整理汇总了Java中java.io.UnsupportedEncodingException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java UnsupportedEncodingException.getMessage方法的具体用法?Java UnsupportedEncodingException.getMessage怎么用?Java UnsupportedEncodingException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.UnsupportedEncodingException的用法示例。


在下文中一共展示了UnsupportedEncodingException.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decodeValue

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * 字符转码
 * @param aValue
 * @return
 * @see 转码后的字符串
 */
public static String decodeValue(String aValue)
{
	if(aValue.trim().length() ==0)
	{
		return "";
	}
	String valueAfterTransCode = null;
	try
	{
		valueAfterTransCode = URLDecoder.decode(aValue, "UTF-8");
	}
	catch (UnsupportedEncodingException e)
	{
		e.getMessage();
	}
	return valueAfterTransCode;
}
 
开发者ID:cendi2005,项目名称:jshERP,代码行数:24,代码来源:Tools.java

示例2: utf8ToIso88591

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * UTF-8编码转换为ISO-9959-1
 *
 * @param str
 * @return
 */
public static String utf8ToIso88591(String str) {
    if (str == null) {
        return str;
    }

    try {
        return new String(str.getBytes("UTF-8"), "ISO-8859-1");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}
 
开发者ID:readen,项目名称:Relay,代码行数:18,代码来源:MessageDigestUtil.java

示例3: iso88591ToUtf8

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * ISO-9959-1编码转换为UTF-8
 *
 * @param str
 * @return
 */
public static String iso88591ToUtf8(String str) {
    if (str == null) {
        return str;
    }

    try {
        return new String(str.getBytes("ISO-8859-1"), "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}
 
开发者ID:readen,项目名称:Relay,代码行数:18,代码来源:MessageDigestUtil.java

示例4: decode

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * Decodes a URL safe string into its original form using the default string charset. Escaped characters are
 * converted back to their original representation.
 *
 * @param str
 *            URL safe string to convert into its original form
 * @return original string
 * @throws DecoderException
 *             Thrown if URL decoding is unsuccessful
 * @see #getDefaultCharset()
 */
@Override
public String decode(final String str) throws DecoderException {
    if (str == null) {
        return null;
    }
    try {
        return decode(str, getDefaultCharset());
    } catch (final UnsupportedEncodingException e) {
        throw new DecoderException(e.getMessage(), e);
    }
}
 
开发者ID:HTBridge,项目名称:pivaa,代码行数:23,代码来源:URLCodec.java

示例5: createField

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */    
public TagField createField(Artwork artwork) throws FieldDataInvalidException
{
    AbstractID3v2Frame frame = createFrame(getFrameAndSubIdFromGenericKey(FieldKey.COVER_ART).getFrameId());
    FrameBodyAPIC body = (FrameBodyAPIC) frame.getBody();
    if(!artwork.isLinked())
    {
        body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, artwork.getBinaryData());
        body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
        body.setObjectValue(DataTypes.OBJ_MIME_TYPE, artwork.getMimeType());
        body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
        return frame;
    }
    else
    {
        try
        {
            body.setObjectValue(DataTypes.OBJ_PICTURE_DATA,artwork.getImageUrl().getBytes("ISO-8859-1"));
        }
        catch(UnsupportedEncodingException uoe)
        {
            throw new RuntimeException(uoe.getMessage());
        }
        body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
        body.setObjectValue(DataTypes.OBJ_MIME_TYPE, FrameBodyAPIC.IMAGE_IS_URL);
        body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
        return frame;
    }
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:32,代码来源:ID3v23Tag.java

示例6: getUrl

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public URL getUrl() {
    try {
        return URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":20880?" + Constants.APPLICATION_KEY + "=abc&" + Constants.SIDE_KEY + "=" + Constants.CONSUMER_SIDE + "&" + Constants.MONITOR_KEY + "=" + URLEncoder.encode("dubbo://" + NetUtils.getLocalHost() + ":7070", "UTF-8"));
    } catch (UnsupportedEncodingException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }
}
 
开发者ID:zhuxiaolei,项目名称:dubbo2,代码行数:8,代码来源:MonitorFilterTest.java

示例7: decode

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public static String decode(String value) {
    if (value == null || value.length() == 0) { 
        return "";
    }
    try {
        return URLDecoder.decode(value, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}
 
开发者ID:flychao88,项目名称:dubbocloud,代码行数:11,代码来源:URL.java

示例8: toString

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
protected String toString(byte[] data) throws ClassificationException {
	try {
		return new String(data, "UTF-8");
	} catch (UnsupportedEncodingException e) {
		throw new ClassificationException("UnsupportedEncodingException raised: " + e.getMessage());
	}
}
 
开发者ID:Smartlogic-Semaphore-Limited,项目名称:Java-APIs,代码行数:8,代码来源:XMLReader.java

示例9: encode

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public static String encode(String value) {
    if (value == null || value.length() == 0) { 
        return "";
    }
    try {
        return URLEncoder.encode(value, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}
 
开发者ID:zhuxiaolei,项目名称:dubbo2,代码行数:11,代码来源:URL.java

示例10: decode

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * Decodes a Base64 string into its original form. Escaped characters are converted back to their original
 * representation.
 * 
 * @param value
 *            Base64 string to convert into its original form
 * @return original string
 * @throws DecoderException
 *             A decoder exception is thrown if a failure condition is encountered during the decode process.
 */
public String decode(String value) throws DecoderException {
    if (value == null) {
        return null;
    }
    try {
        return decodeText(value);
    } catch (UnsupportedEncodingException e) {
        throw new DecoderException(e.getMessage(), e);
    }
}
 
开发者ID:mozilla-mobile,项目名称:FirefoxData-android,代码行数:21,代码来源:BCodec.java

示例11: createPatch

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * Create Patch Request
 */
public HttpPatch createPatch(String url, JSON data) {
    HttpPatch patch = new HttpPatch(url);
    patch.setHeader("Content-Type", "application/json");

    String string = data.toString(1);
    try {
        patch.setEntity(new StringEntity(string, "UTF-8"));
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
    return patch;
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:16,代码来源:HttpUtils.java

示例12: toBytes

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * String转换为字节数组
 *
 * @param str
 * @return
 */
private static byte[] toBytes(final String str) {
    if (str == null) {
        return null;
    }
    try {
        return str.getBytes(Constants.ENCODING);
    } catch (final UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}
 
开发者ID:linkingli,项目名称:FaceDistinguish,代码行数:17,代码来源:MessageDigestUtil.java

示例13: decode

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public static String decode(String value) {
    if (value == null || value.length() == 0) {
        return "";
    }
    try {
        return URLDecoder.decode(value, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}
 
开发者ID:venus-boot,项目名称:saluki,代码行数:11,代码来源:GrpcURL.java

示例14: createField

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public TagField createField(Artwork artwork) throws FieldDataInvalidException
{
    AbstractID3v2Frame frame = createFrame(getFrameAndSubIdFromGenericKey(FieldKey.COVER_ART).getFrameId());
    FrameBodyAPIC body = (FrameBodyAPIC) frame.getBody();
    if(!artwork.isLinked())
    {
        body.setObjectValue(DataTypes.OBJ_PICTURE_DATA, artwork.getBinaryData());
        body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
        body.setObjectValue(DataTypes.OBJ_MIME_TYPE, artwork.getMimeType());
        body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
        return frame;
    }
    else
    {
        try
        {
            body.setObjectValue(DataTypes.OBJ_PICTURE_DATA,artwork.getImageUrl().getBytes("ISO-8859-1"));
        }
        catch(UnsupportedEncodingException uoe)
        {
            throw new RuntimeException(uoe.getMessage());
        }
        body.setObjectValue(DataTypes.OBJ_PICTURE_TYPE, artwork.getPictureType());
        body.setObjectValue(DataTypes.OBJ_MIME_TYPE, FrameBodyAPIC.IMAGE_IS_URL);
        body.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
        return frame;
    }
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:29,代码来源:ID3v24Tag.java

示例15: urlEncode

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * URL编码
 * 
 * @param s
 * @return
 */
public String urlEncode(String s) {
	if (WakaUtils.string.isEmpty(s)) {
		return "";
	}
	try {
		return URLEncoder.encode(s, I18NConstants.DEFAULT_CHARSET);
	} catch (UnsupportedEncodingException e) {
		throw new ZhhrUtilException(e.getMessage(), e);
	}
}
 
开发者ID:wooui,项目名称:springboot-training,代码行数:17,代码来源:EncodeUtil.java


注:本文中的java.io.UnsupportedEncodingException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。