當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。