久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何修復(fù) 1 字節(jié) UTF-8 序列的無效字節(jié) 1

How to fix Invalid byte 1 of 1-byte UTF-8 sequence(如何修復(fù) 1 字節(jié) UTF-8 序列的無效字節(jié) 1)
本文介紹了如何修復(fù) 1 字節(jié) UTF-8 序列的無效字節(jié) 1的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在嘗試使用 java 方法從 db 中獲取以下 xml,但出現(xiàn)錯誤

I am trying to fetch the below xml from db using a java method but I am getting an error

用于解析 xml 的代碼

Code used to parse the xml

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();

InputSource is = new InputSource(new ByteArrayInputStream(cond.getBytes()));

Document doc = db.parse(is);

Element elem = doc.getDocumentElement();

// here we expect a series of <data><name>N</name><value>V</value></data>
NodeList nodes = elem.getElementsByTagName("data");

TableID jobId = new TableID(_processInstanceId);
Job myJob = Job.queryByID(_clientContext, jobId, true);

if (nodes.getLength() == 0) {
    log(Level.DEBUG, "No data found on condition XML");

}

for (int i = 0; i < nodes.getLength(); i++) {
    // loop through the <data> in the XML

    Element dataTags = (Element) nodes.item(i);
    String name = getChildTagValue(dataTags, "name");
    String value = getChildTagValue(dataTags, "value");

    log(Level.INFO, "UserData/Value=" + name + "/" + value);

    myJob.setBulkUserData(name, value);
}

myJob.save();

數(shù)據(jù)

<ContactDetails>307896043</ContactDetails>
<ContactName>307896043</ContactName>
<Preferred_Completion_Date>
</Preferred_Completion_Date>
<service_address>A-End Address: 1ST HELIERST HELIERJT2 3XP832THE CABLES 1 POONHA LANEST HELIER JE JT2 3XP</service_address>
<ServiceOrderId>315473043</ServiceOrderId>
<ServiceOrderTypeId>50</ServiceOrderTypeId>
<CustDesiredDate>2013-03-20T18:12:04</CustDesiredDate>
<OrderId>307896043</OrderId>
<CreateWho>csmuser</CreateWho>
<AccountInternalId>20100333</AccountInternalId>
<ServiceInternalId>20766093</ServiceInternalId>
<ServiceInternalIdResets>0</ServiceInternalIdResets>
<Primary_Offer_Name  action='del'>MyMobile Blue &#163;44.99 [12 month term]</Primary_Offer_Name>
<Disc_Reason  action='del'>8</Disc_Reason>
<Sup_Offer  action='del'>80000257</Sup_Offer>
<Service_Type  action='del'>A-01-00</Service_Type>
<Priority  action='del'>4</Priority>
<Account_Number  action='del'>0</Account_Number>
<Offer  action='del'>80000257</Offer>
<msisdn  action='del'>447797142520</msisdn>
<imsi  action='del'>234503184</imsi>
<sim  action='del'>5535</sim>
<ocb9_ARM  action='del'>false</ocb9_ARM>
<port_in_required  action='del'>
</port_in_required>
<ocb9_mob  action='del'>none</ocb9_mob>
<ocb9_mob_BB  action='del'>
</ocb9_mob_BB>
<ocb9_LandLine  action='del'>
</ocb9_LandLine>
<ocb9_LandLine_BB  action='del'>
</ocb9_LandLine_BB>
<Contact_2>
</Contact_2>
<Acc_middle_name>
</Acc_middle_name>
<MarketCode>7</MarketCode>
<Acc_last_name>Port_OUT</Acc_last_name>
<Contact_1>
</Contact_1>
<Acc_first_name>.</Acc_first_name>
<EmaiId>
</EmaiId>

錯誤

 org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.

我在一些線程中讀到這是因為 xml 中的一些特殊字符.如何解決這個問題?

I read in some threads it's because of some special characters in the xml. How to fix this issue ?

推薦答案

如何解決這個問題?

How to fix this issue ?

使用正確的字符編碼讀取數(shù)據(jù).錯誤消息意味著您正在嘗試以 UTF-8 格式讀取數(shù)據(jù)(有意或因為這是未指定 <?xml version="1.0" encoding="somethingelse 的 XML 文件的默認(rèn)編碼"?>) 但它實際上采用不同的編碼,例如 ISO-8859-1 或 Windows-1252.

Read the data using the correct character encoding. The error message means that you are trying to read the data as UTF-8 (either deliberately or because that is the default encoding for an XML file that does not specify <?xml version="1.0" encoding="somethingelse"?>) but it is actually in a different encoding such as ISO-8859-1 or Windows-1252.

為了能夠建議您應(yīng)該如何執(zhí)行此操作,我必須查看您當(dāng)前用于讀取 XML 的代碼.

To be able to advise on how you should do this I'd have to see the code you're currently using to read the XML.

這篇關(guān)于如何修復(fù) 1 字節(jié) UTF-8 序列的無效字節(jié) 1的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Upload progress listener not fired (Google drive API)(上傳進度偵聽器未觸發(fā)(Google 驅(qū)動器 API))
Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 將文件保存在特定文件夾中)
Google Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 無效的 DriveId 和 Null ResourceId)
Google drive api services account view uploaded files to google drive using java(谷歌驅(qū)動api服務(wù)賬戶查看上傳文件到谷歌驅(qū)動使用java)
Google Drive service account returns 403 usageLimits(Google Drive 服務(wù)帳號返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例中缺少)
主站蜘蛛池模板: av色站| 亚洲一区二区三区免费 | 午夜精品在线 | 天堂中文字幕av | 欧美精品一区二区三区在线播放 | 国产91黄色 | 激情网站在线 | 免费观看黄色片视频 | 欧美日韩亚洲视频 | 亚洲高清在线观看 | 国产剧情一区二区三区 | 另类视频区 | 欧美综合国产精品久久丁香 | 亚洲高清av在线 | 国产伦精品一区二区三区照片91 | 日韩成人国产 | 日本成人久久 | 99亚洲| 北条麻妃99精品青青久久 | 视频二区国产 | 免费视频一区 | 99在线免费观看视频 | 免费国产一区二区 | 成年人网站免费视频 | 韩国精品一区二区三区 | 精品蜜桃一区二区三区 | 久久亚洲视频网 | 国产女人与拘做受视频 | 午夜在线视频 | 国产一二区在线 | 在线观看视频你懂得 | 国精品一区二区 | 日韩精品一区二区三区视频播放 | 成人一级片在线观看 | 特黄一级 | 亚洲国产午夜 | 国产中文字幕网 | 亚洲第一福利网 | 天天操天天操 | 91精品久久久久久久久中文字幕 | 亚洲精品视频在线看 |